(function() {
	if (!window.nahf || !window.nahf.extend) {
		var a = window.nahf = {};
		a.extend = function(d, e, c) {
			var b = c !== undefined ? c : true, f;
			for (f in e) {
				if (!d[f] || b) {
					d[f] = e[f]
				}
			}
			return d
		}
	} else {
		return
	}
	a
			.extend(
					a,
					{
						version : "1.1",
						Array : {
							compact : function(c) {
								if (!c) {
									return []
								}
								for ( var e = 0, d = [], b = c.length; e < b; e += 1) {
									if (!(c[e] === null || typeof (c[e]) === "undefined")) {
										d.push(c[e])
									}
								}
								return d
							},
							each : function(c, e) {
								if (Array.prototype.forEach) {
									return c.forEach(e)
								}
								for ( var d = 0, b = c.length; d < b; d += 1) {
									e(c[d], d)
								}
							},
							indexOf : function() {
								if ([].indexOf) {
									return function(b, c) {
										return b.indexOf(c)
									}
								} else {
									return function(c, e) {
										for ( var d = 0, b = c.length; d < b; d += 1) {
											if (c[d] === e) {
												return d
											}
										}
										return -1
									}
								}
							}(),
							contains : function(b, c) {
								return b.indexOf(c) > -1
							}
						},
						Browser : {
							ua : navigator.userAgent.toLowerCase(),
							offset : {
								width : 0,
								height : 0
							},
							browserInit : function() {
								this.ie = this.ua.indexOf("msie") != -1;
								this.ie_sv1 = this.ua.indexOf("sv1") != -1;
								this.ie_sv2 = this.ua.indexOf("sv2") != -1;
								this.ie6 = this.ua.indexOf("msie 6") != -1;
								this.ie7 = this.ua.indexOf("msie 7") != -1;
								this.ie8 = this.ua.indexOf("trident/4.0") != -1;
								this.ie9 = this.ua.indexOf("msie 9") != -1;
								this.ie10 = this.ua.indexOf("msie 10") != -1;
								this.ff = this.ua.indexOf("firefox") != -1
										&& this.ua.indexOf("navigator") == -1;
								this.ff2 = this.ff
										&& this.ua.indexOf("firefox/2.") != -1;
								this.ff3 = this.ff
										&& this.ua.indexOf("firefox/3.") != -1;
								this.sf = this.ua.indexOf("safari") != -1
										&& this.ua.indexOf("chrome") == -1;
								this.webkit = this.ua.indexOf("applewebkit") != -1;
								this.op = this.ua.indexOf("opera") != -1;
								this.cr = this.ua.indexOf("chrome/") != -1;
								this.ns = this.ua.indexOf("netscape") != -1
										|| (this.ua.indexOf("firefox") != -1 && this.ua
												.indexOf("navigator") != -1);
								this.gecko = this.ua.indexOf("gecko") != -1;
								this.infopath = this.ua.indexOf("infopath") != -1;
								this.etc = this.gecko && this.ff && this.ns;
								this.win = this.ua.indexOf("win") != -1;
								this.vista = this.ua.indexOf("nt 6") != -1;
								this.xp = this.ua.indexOf("nt 5.1") != -1;
								this.w2k = this.ua.indexOf("nt 5.0") != -1;
								this.w98 = this.ua.indexOf("windows 98") != -1;
								this.mac = this.ua.indexOf("mac") != -1;
								this.unix = !(this.win || this.mac);
								this.ipad = this.ua.indexOf("ipad;") != -1;
								this.versioning();
								return
							},
							ua_contains : function(d) {
								var b = (typeof d == "string") ? new Array(d)
										: d, c = 0;
								b.each(function(e) {
									c += (e.substr(0, 1) == "!") ? a.Browser.ua
											.indexOf(e.substr(1)) === -1
											: a.Browser.ua.indexOf(e) > -1
								});
								return b.length === c
							},
							versioning : function() {
								if (this.ie) {
									if (this.ie8) {
										this.ie7 = this.ie6 = this.ie_sv2 = this.ie_sv1 = false
									}
									if (this.ie7) {
										this.ie6 = this.ie_sv2 = this.ie_sv1 = false
									}
								}
								if (this.ff) {
									if (this.ff3) {
										this.ff2 = false
									}
								}
								if (this.sf && this.cr) {
									this.sf = false
								}
							}
						},
						Element : {
							cleanBlankNodes : function(c) {
								var d = a.$(c), b = d.firstChild;
								try {
									do {
										if (b.nodeType === 3
												&& !/\S/.test(b.nodeValue)) {
											d.removeChild(b)
										}
									} while (b = b.nextSibling)
								} catch (d) {
								}
								return d
							},
							getChildElements : function(d) {
								var c = a.$(d).firstChild, b = [];
								try {
									do {
										if (c.nodeType === 1) {
											b.push(c)
										}
									} while (c = c.nextSibling)
								} catch (f) {
								}
								return b
							},
							getElementsByClassName : function(g, d) {
								if (document.getElementsByClassName.toString()
										.indexOf("native") > 0) {
									return a.$A(g.getElementsByClassName(d))
								}
								var h = g == document || g == document.body
										|| g == window;
								if (h || g.id) {
									return a.$$((h ? "" : "#" + g.id + " ")
											+ "."
											+ a.String.trim(d).replace(/\s+/g,
													"."))
								}
								for ( var c = a.$(g).getElementsByTagName("*"), f = [], e = 0, b = c.length; e < b; e += 1) {
									if (a.Element.hasClassName(c[e], d)) {
										f.push(c[e])
									}
								}
								return (f.length > 0) ? f : []
							},
							getFirstChild : function(b) {
								var c = a.$(b).firstChild;
								while (c && c.nodeType !== 1) {
									c = c.nextSibling
								}
								return c
							},
							getLastChild : function(c) {
								var b = a.$(c).lastChild;
								while (b && b.nodeType !== 1) {
									b = b.previousSibling
								}
								return b
							},
							getNext : function(c) {
								var b = a.$(c).nextSibling;
								while (b && b.nodeType !== 1) {
									b = b.nextSibling
								}
								return b
							},
							getPrev : function(b) {
								var c = a.$(b).previousSibling;
								while (c && c.nodeType !== 1) {
									c = c.previousSibling
								}
								return c
							},
							getParent : function(b) {
								return a.$(b).parentNode
							},
							getCoords : function(c, d, k) {
								var g = d || false, l = a.$(k) || false, i = a
										.$(c), m = i.offsetWidth, f = i.offsetHeight, j = {
									left : 0,
									top : 0,
									right : 0,
									bottom : 0
								}, b;
								while (i) {
									j.left += i.offsetLeft || 0;
									j.top += i.offsetTop || 0;
									i = i.offsetParent;
									if (g) {
										if (i) {
											if (i.tagName == "BODY") {
												break
											}
											b = a.Element.getStyle(i,
													"position");
											if (b !== "static") {
												break
											}
										}
									}
									if (l && l == i) {
										break
									}
								}
								j.right = j.left + m;
								j.bottom = j.top + f;
								return j
							},
							getCoordsTarget : function(c, b) {
								return a.Element.getCoords(c, false, b)
							},
							getStyle : function(f, g, d) {
								var i = a.$(f), b, h, c, j = d || g;
								if (g.toLowerCase() == "float") {
									c = (a.Browser.ie) ? "styleFloat"
											: "cssFloat"
								} else {
									c = g
								}
								if (i.currentStyle) {
									h = (c.indexOf("-") !== -1) ? c.replace(
											/[\-](.)/g, function(k, e) {
												return e.toUpperCase()
											}) : c;
									b = i.currentStyle[h]
								} else {
									h = (/[A-Z]/.test(j)) ? j.replace(
											/([A-Z])/g, function(k, e) {
												return "-" + e.toLowerCase()
											}) : j;
									b = document.defaultView.getComputedStyle(
											i, null).getPropertyValue(h)
								}
								return b
							},
							hasClassName : function(d, c) {
								var f = a.String.trim(a.$(d).className)
										.replace(/\s+/g, " ").split(" "), e = a.String
										.trim(c).replace(/\s+/g, " ")
										.split(" "), b = true;
								a.Array.each(e, function(g) {
									b = a.Array.contains(f, g) && b
								});
								return b
							},
							visible : function(b) {
								var c = a.$(b);
								return !(c.offsetWidth === 0 && c.offsetHeight === 0)
							},
							show : function(b, d) {
								var c = a.$(b);
								c.style.display = d || "block";
								return c
							},
							hide : function(b) {
								var c = a.$(b);
								c.style.display = "none";
								return c
							},
							toggle : function(b, d) {
								var c = a.$(b);
								return (a.Element.visible(c)) ? a.Element
										.hide(c) : a.Element.show(c, d
										|| "block")
							},
							addClassName : function(c, b) {
								var d = a.$(c);
								if (a.Element.hasClassName(d, b)) {
									return d
								}
								d.className = (a.String.trim(d.className) === "") ? b
										: d.className + " " + b;
								return d
							},
							removeClassName : function(c, b) {
								return a.Element.replaceClassName(c, b, "")
							},
							replaceClassName : function(c, f, h) {
								var d = a.$(c), b = [], g = a.String.trim(
										a.$(c).className).replace(/\s+/g, " ")
										.split(" ");
								a.Array.each(g, function(e) {
									e === f ? h && b.push(h) : b.push(e)
								});
								d.className = b.join(" ");
								return d
							},
							setOpacity : function(b, d) {
								var c = a.$(b);
								c.style.filter = "alpha(opacity=" + d * 100
										+ ")";
								c.style.opacity = c.style.MozOpacity = c.style.KhtmlOpacity = d;
								return c
							}
						},
						Event : {
							observer : [],
							EVENTID : 0,
							crossEvent : function() {
								var b = {};
								if (!!document.addEventListener) {
									b.add = function(d) {
										var c = d.type;
										if (c.toLowerCase() == "mousewheel"
												&& a.Browser.ff) {
											c = "DOMMouseScroll"
										}
										d.src.addEventListener(c, d.handler,
												d.isCapture)
									};
									b.remove = function(d) {
										var c = d.type;
										if (c.toLowerCase() == "mousewheel"
												&& a.Browser.ff) {
											c = "DOMMouseScroll"
										}
										d.src.removeEventListener(c, d.handler,
												d.isCapture)
									}
								} else {
									b.add = function(d) {
										var c = d.type;
										if (c.toLowerCase() == "dommousescroll") {
											c = "mousewheel"
										}
										d.src.attachEvent("on" + c, d.handler)
									};
									b.remove = function(d) {
										var c = d.type;
										if (c.toLowerCase() == "dommousescroll") {
											c = "mousewheel"
										}
										d.src.detachEvent("on" + c, d.handler)
									}
								}
								return b
							}(),
							bindedHandlerRegister : [],
							getBindedHandler : function(g, f) {
								var e = a.Event.bindedHandlerRegister, b = -1, d, c;
								for (d = 0, loop = e.length; d < loop; d += 1) {
									if (e[d].src === g && e[d].handler === f) {
										b = d;
										break
									}
								}
								if (b >= 0) {
									return e[b].bindedHandler
								} else {
									c = a.Function.bindAsEventListener(f, g);
									e.push({
										src : g,
										handler : f,
										bindedHandler : c
									});
									return c
								}
							},
							addEvent : function(f, i, j, e) {
								var b = a.$(f), h = false, d = -1, c = a.Event.EVENTID++, g = {
									src : b,
									type : i,
									handler : j,
									isCapture : e || false
								};
								a.Event.observer[c] = g;
								a.Event.crossEvent.add(g);
								return c
							},
							removeEvent : function(f, e, d, c) {
								var b = a.Event.observer;
								if (!!f && !e && !d) {
									a.Event.crossEvent.remove(b[f]);
									delete a.Event.observer[f]
								} else {
									var h = a.$(f);
									a.Event.crossEvent.remove({
										src : h,
										type : e,
										handler : d,
										isCapture : c || false
									});
									for ( var g in b) {
										if (b[g].src === h
												&& b[g].type === e
												&& b[g].handler === d
												&& b[g].isCapture === (c || false)) {
											delete a.Event.observer[g];
											break
										}
									}
								}
							},
							stopObserving : function(b) {
								if (a.Event.observer[b]) {
									a.Event.removeEvent(b)
								}
							},
							hasObserver : function(f, d) {
								if (typeof f === "number") {
									return !!a.Event.observer[f]
								} else {
									var c = false, b = a.Event.observer;
									for ( var e in b) {
										if (b[e].src === f && b[e].type === d) {
											c = true;
											break
										}
									}
									return c
								}
							},
							stopEvent : function(b) {
								a.Event.stopPropagation(b);
								a.Event.preventDefault(b);
								return false
							},
							preventDefault : function(c) {
								var b = c || window.event;
								if (b.preventDefault) {
									b.preventDefault()
								} else {
									b.returnValue = false
								}
								return false
							},
							stopPropagation : function(c) {
								var b = c || window.event;
								if (b.stopPropagation) {
									b.stopPropagation()
								} else {
									b.cancelBubble = true
								}
							},
							GC : function() {
								if (a.Browser.ie) {
									return function() {
										for ( var b in a.Event.observer) {
											var c = a.Event.observer[b].src;
											if (c && c.ownerDocument) {
												try {
													!c.offsetParent
															&& a.Event
																	.stopObserving(b)
												} catch (c) {
													a.Event.stopObserving(b)
												}
											}
										}
									}
								} else {
									return function() {
										for ( var b in a.Event.observer) {
											var d = a.Event.observer[b].src, c = false;
											if (d && d.ownerDocument) {
												if (!d.offsetParent) {
													do {
														if (d === document.body) {
															c = true;
															break
														}
													} while (d = d.parentNode);
													!c
															&& a.Event
																	.stopObserving(b)
												}
											}
										}
									}
								}
							}
						},
						Function : {
							bind : function(e) {
								var g = e, c = a.$A(arguments), b, d;
								c.shift();
								b = c.shift();
								d = function() {
									return g
											.apply(b, c.concat(a.$A(arguments)))
								};
								d.__Binded = true;
								return d
							},
							bindAsEventListener : function(e) {
								var g = e, c = a.$A(arguments), b, d;
								c.shift();
								b = c.shift();
								d = function(f) {
									return g.apply(b, [ f || window.event ]
											.concat(c))
								};
								d.__Binded = true;
								return d
							},
							interval : function(e, b, d) {
								var c = (d) ? a.Function.bind(e, d) : e;
								return window.setInterval(c, b)
							},
							timeout : function(e, b, d) {
								var c = (d) ? a.Function.bind(e, d) : e;
								return window.setTimeout(c, b)
							}
						},
						Fx : {},
						Number : {},
						Object : {
							isArray : function(b) {
								return (a.Object.getType(b) === "Array")
							},
							isBoolean : function(b) {
								return (a.Object.getType(b) === "Boolean")
							},
							isFunction : function(b) {
								return (a.Object.getType(b) === "Function")
							},
							isString : function(b) {
								return (a.Object.getType(b) === "String")
							},
							isNumber : function(b) {
								return (a.Object.getType(b) === "Number")
							},
							isObject : function(b) {
								return (a.Object.getType(b) === "Object")
							},
							getType : function(b) {
								return Object.prototype.toString.call(b)
										.toString().match(/\[object\s(\w*)\]$/)[1]
							},
							toJSON : function(b) {
								return a.toJSON(b)
							}
						},
						String : {
							trim : function(b) {
								return b.replace(/^\s\s*/, "").replace(
										/\s\s*$/, "")
							},
							replaceAll : function() {
								return function(c, b, d) {
									if (b.constructor == RegExp) {
										return c.replace(
												new RegExp(b.toString()
														.replace(/^\/|\/$/gi,
																""), "gi"), d)
									}
									return c.split(b).join(d)
								}
							}(),
							byteLength : function(c) {
								var b = 0;
								a.$A(c.toString()).each(function(d) {
									b += (escape(d).length > 3) ? 2 : 1
								});
								return b
							},
							cutString : function(e, b, d) {
								var g = d || "", f = b - g.length, i = 0, h = "", c;
								a.$A(e.toString()).each(function(j) {
									c = (escape(j).length > 3) ? 2 : 1;
									i += c;
									f -= c;
									if (f >= 0) {
										h += j
									}
								});
								return (b >= i) ? e : h += g
							}
						},
						$ : function(b) {
							return typeof b == "string" ? document
									.getElementById(b) : b
						},
						$A : function(d) {
							if (!d) {
								return []
							}
							if (d instanceof Array && !a.Browser.op) {
								return d
							}
							var f = (typeof d == "string" && (a.ie || a.op)) ? d
									.split("")
									: d, b;
							try {
								b = Array.prototype.slice.call(f)
							} catch (h) {
								for ( var g = 0, b = [], c = d.length; g < c; g += 1) {
									b.push(d[g])
								}
							}
							return b
						},
						$C : function(b, d) {
							var c = a.$(b);
							return (c !== null) ? a.Element
									.getElementsByClassName(c, d) : null
						},
						$E : function(c) {
							var b = a.$(c);
							if (b) {
								a.extendMethods(b, a.Element, false);
								b.addEvent = a.methodize(a.Event.addEvent);
								b.removeEvent = a
										.methodize(a.Event.removeEvent)
							}
							return b
						},
						$F : function(d) {
							var f = a.$(d) || document.getElementsByName(d)[0], c, g, b;
							if (!f
									|| (f.tagName !== "INPUT"
											&& f.tagName !== "SELECT" && f.tagName !== "TEXTAREA")) {
								return ""
							}
							if (f.type == "radio" || f.type == "checkbox") {
								for (c = 0, g = document
										.getElementsByName(f.name),
										b = new Array(); c < g.length; c += 1) {
									if (g[c].checked) {
										b.push(g[c].value)
									}
								}
								b = (f.type == "radio") ? b[0] : b
							} else {
								if (f.type == "select-multiple") {
									for (c = 0, g = a.Element
											.getChildElements(f),
											b = new Array(); c < g.length; c += 1) {
										if (g[c].selected) {
											b.push(g[c].value)
										}
									}
								} else {
									if (f.value) {
										b = f.value
									}
								}
							}
							return b
						},
						$T : function(b, c) {
							return (c || document).getElementsByTagName(b)
						},
						activeX : function() {
							return function(k, d, c) {
								var o = new Date(), f = c || false, n = o
										.getMinutes().toString()
										+ o.getSeconds() + o.getMilliseconds(), i = k.param, j, m, h = false, b = null, l = "<object ", g, e;
								l += 'id="'
										+ ((!k.id) ? "nahfActiveX" + n + '" '
												: k.id + '" ');
								l += 'name="'
										+ ((!k.name) ? "nahfActiveX" + n + '" '
												: k.name + '" ');
								l += (k.type) ? 'type="' + k.type + '" ' : "";
								l += (k.classid) ? 'classid="' + k.classid
										+ '" ' : "";
								l += (k.width) ? 'width="' + k.width + '" '
										: "";
								l += (k.height) ? 'height="' + k.height + '" '
										: "";
								l += (k.codebase) ? 'codebase="' + k.codebase
										+ '" ' : "";
								l += ">\r\n";
								for (j in i) {
									if (i.hasOwnProperty(j)) {
										l += '<param name="' + j + '" value="'
												+ i[j] + '" />\r\n'
									}
								}
								l += "<embed ";
								l += 'id="'
										+ ((!k.id) ? "nahfActiveX" + n + '" '
												: k.id + '" ');
								l += 'name="'
										+ ((!k.name) ? "nahfActiveX" + n + '" '
												: k.name + '" ');
								l += (k.type) ? 'type="' + k.type + '" ' : "";
								l += (k.width) ? 'width="' + k.width + '" '
										: "";
								l += (k.height) ? 'height="' + k.height + '" '
										: "";
								for (j in i) {
									if (i.hasOwnProperty(j)) {
										m = j.toLowerCase();
										if (m) {
											if (m == "movie" || m == "src") {
												b = i[j]
											}
											if (m != "flashvars") {
												l += m + '="' + i[j] + '" '
											} else {
												h = i[j]
											}
										}
									}
								}
								l += " />\r\n</object>\r\n";
								if (!!h && !!b) {
									l = l
											.replace(
													'src="' + b + '"',
													'src="'
															+ b
															+ (b.indexOf("?") == -1 ? "?"
																	: "&") + h
															+ '"')
								}
								if (!f) {
									g = a.$(d);
									if (a.Browser.ie
											|| k.type == "application/x-shockwave-flash"
											|| k.classid.toLowerCase() == "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
											|| (a.Browser.win && k.classid
													.toLowerCase() == "clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95")) {
										if (!f) {
											g.innerHTML = l
										}
									}
									e = a.Element.getFirstChild(g);
									return (a.Browser.ie) ? e : e
											.getElementsByTagName("embed")[0]
								} else {
									return l
								}
							}
						}(),
						documentLoaded : false,
						extendMethods : function(d, e, c) {
							var b = c !== undefined ? c : true, f;
							for (f in e) {
								if (!d[f] || b) {
									if (typeof (e[f]) == "function") {
										d[f] = a.methodize(e[f])
									}
								}
							}
							return d
						},
						methodize : function(b) {
							return function() {
								return b.apply(null, [ this ].concat(a
										.$A(arguments)))
							}
						},
						nativeExtend : function() {
							var c = [ [ a.Object, Object ],
									[ a.String, String.prototype ],
									[ a.Number, Number.prototype ],
									[ a.Array, Array.prototype ],
									[ a.Function, Function.prototype ] ], d, b = c.length;
							Array.prototype.isArray = true;
							Number.prototype.isNumber = true;
							String.prototype.isString = true;
							Function.prototype.isFunction = true;
							for (d = 0; d < b; d += 1) {
								a.extendMethods(c[d][1], c[d][0], false)
							}
						},
						random : function(c, b) {
							return Math.floor(Math.random() * (b - c + 1) + c)
						},
						showFlash : function(g, e, c, h, b) {
							var d = {
								quality : "high",
								wmode : "transparent",
								bgcolor : "#FFFFFF",
								pluginspace : "http://www.macromedia.com/go/getflashplayer",
								allowScriptAccess : "always",
								allowFullScreen : "true",
								htmltext : false
							}, f = {
								type : "application/x-shockwave-flash",
								classid : "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000",
								codebase : "http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0",
								wmode : "transparent",
								width : e,
								height : c,
								param : {
									movie : g,
									src : g
								}
							};
							a.extend(d, b || {});
							a.extend(f.param, d);
							if (location.toString().indexOf("https://") != -1) {
								f.codebase = f.codebase.replace("http://",
										"https://")
							}
							return a.activeX(f, h, d.htmltext)
						}
					})
})();
(function() {
	nahf.Browser.browserInit();
	if (!document.getElementsByClassName) {
		document.getElementsByClassName = nahf
				.methodize(nahf.Element.getElementsByClassName)
	}
	if (String.prototype.trim) {
		nahf.String.trim = function(a) {
			return a.trim()
		}
	}
	return true
})();
nahf
		.extend(
				nahf,
				{
					createElement : function(h, g) {
						var m, a = "", k = nahf.HTMLStack, f, b, j, l, c;
						if (!g) {
							m = nahf.String.startsWith(h, "<") ? h : ("<" + h
									+ "></" + h + ">")
						} else {
							for (c in g) {
								a += c + '="' + g[c] + '" '
							}
							m = "<" + h + " " + a + "></" + h + ">"
						}
						try {
							k.innerHTML = m;
							f = k.removeChild(k.firstChild);
							if (f.nodeType !== 1) {
								throw ({
									message : "shit browser!"
								})
							} else {
								return f
							}
						} catch (d) {
							b = m.match(/\w+/).toString().toLowerCase();
							j = {
								tbody : [ "<table>", "</table>" ],
								tr : [ "<table><tbody>", "</tbody></table>" ],
								td : [ "<table><tbody><tr>",
										"</tr></tbody></table>" ],
								option : [ "<select>", "</select>" ]
							};
							if (j[b]) {
								k.innerHTML = j[b][0] + m + j[b][1];
								l = k.removeChild(k.firstChild);
								return l.getElementsByTagName(b)[0]
							} else {
								return document.createElement(b)
							}
						}
					},
					loadedScripts : {},
					loadTimer : {},
					load : function(e, a, b) {
						if (nahf.loadedScripts[e]) {
							if (a) {
								a()
							}
							return false
						}
						var c, d;
						c = document.createElement("script");
						c.type = "text/javascript";
						for (d in b) {
							if (b.hasOwnProperty(d)) {
								c.setAttribute(d, b[d])
							}
						}
						c.src = e;
						nahf.$T("head")[0].appendChild(c);
						if (!a) {
							return false
						}
						c.onreadystatechange = function() {
							if (this.readyState == "loaded"
									|| this.readyState == "complete") {
								if (!nahf.loadedScripts[e]) {
									nahf.loadedScripts[e] = true;
									a()
								}
							}
							return
						};
						c.onload = function() {
							if (!nahf.loadedScripts[e]) {
								nahf.loadedScripts[e] = true;
								a()
							}
							return
						};
						return true
					},
					urlParameter : function() {
						for ( var f = {}, e = [], c = location.search.substr(1)
								.split("&"), d = 0, b = c.length; d < b; d += 1) {
							e = c[d].split("=");
							f[e[0]] = e[1]
						}
						return f
					}(),
					getParam : function(a) {
						return this.urlParameter[a] || null
					},
					useHTMLPrototype : function() {
						nahf.HTMLFragment = (document.createDocumentFragment) ? document
								.createDocumentFragment()
								: document.createElement("div");
						nahf.HTMLPrototype = document.createElement("div");
						nahf.HTMLStack = document.createElement("div");
						nahf.HTMLPrototype.id = "nahf_html_prototype";
						nahf.HTMLStack.id = "nahf_html_stack";
						nahf.HTMLFragment.appendChild(nahf.HTMLPrototype);
						nahf.HTMLFragment.appendChild(nahf.HTMLStack);
						nahf.HTMLPrototype.style.position = nahf.HTMLStack.style.position = "absolute";
						nahf.HTMLPrototype.style.left = nahf.HTMLStack.style.left = nahf.HTMLPrototype.style.top = nahf.HTMLStack.style.top = "-10000px";
						return true
					}(),
					toJSON : function(a) {
						return JSON.stringify(a)
					},
					xmlToObject : function(c) {
						var a = c.documentElement, b = function(h) {
							for ( var m = {}, n = nahf.getChildElements(h), f, k, g = 0, d = n.length; g < d; g += 1) {
								f = n[g].nodeName;
								k = (nahf.getChildElements(n[g]).length > 0) ? b(n[g])
										: (n[g].firstChild == null) ? ""
												: n[g].firstChild.nodeValue;
								if (m[f] != undefined
										|| h.getElementsByTagName(f).length > 1) {
									if (m[f] == undefined) {
										m[f] = []
									}
									m[f].push(k)
								} else {
									m[f] = k
								}
								for ( var e = 0; e < n[g].attributes.length; e += 1) {
									m[f + "@" + n[g].attributes[e].nodeName] = (n[g].attributes[e].nodeValue || "")
											.toString()
								}
							}
							return m
						};
						return b(a)
					},
					jsonToObject : function(a) {
						return JSON.parse(a)
					}
				});
nahf.extend(nahf.Array, {
	copy : function(c) {
		for ( var d = 0, f = [], e, b = c.length; d < b; d += 1) {
			if (c[d].constructor == c.constructor) {
				f[d] = nahf.Array.copy(c[d])
			} else {
				if (typeof (c[d]) == "object") {
					if (typeof (c[d].valueOf()) == "object") {
						f[d] = c[d].constructor();
						for (e in c[d]) {
							f[d][e] = c[d][e]
						}
					} else {
						f[d] = c[d].constructor(c[d].valueOf())
					}
				} else {
					f[d] = c[d]
				}
			}
		}
		return f
	},
	map : function(e, h) {
		if (typeof Array.prototype.map === "function"
				&& Array.prototype.map.toString().indexOf("native") > 0) {
			return e.map(h)
		}
		for ( var c = [], g = 0, d = e.length; g < d; g += 1) {
			c[g] = h(e[g], g)
		}
		return c
	},
	size : function(b) {
		return nahf.Array.compact(b).length
	},
	uniq : function(c) {
		var d = [], e;
		for ( var e = 0, d = [], b = c.length; e < b; e += 1) {
			nahf.Array.contains(d, c[e]) || d.push(c[e])
		}
		return d
	},
	getFirst : function(b) {
		return b[0]
	},
	getLast : function(b) {
		return b[b.length - 1]
	}
});
nahf
		.extend(
				nahf.Browser,
				{
					getWindowSize : function() {
						var a = (document.documentElement.clientWidth
								|| document.body.clientWidth || 1003) - 2, b = (document.documentElement.clientHeight
								|| document.body.clientHeight || 650) - 2;
						return {
							width : a,
							height : b
						}
					},
					getScrollOffsets : function() {
						return {
							left : window.pageXOffset
									|| document.documentElement.scrollLeft
									|| document.body.scrollLeft,
							top : window.pageYOffset
									|| document.documentElement.scrollTop
									|| document.body.scrollTop
						}
					},
					setCookie : function(c, e, a) {
						var f = new Date(), b = "";
						if (a) {
							f.setDate(f.getDate() + a);
							b = "expires=" + f.toGMTString() + ";"
						}
						document.cookie = c + "=" + escape(e) + "; path=/;" + b
					},
					getCookie : function(d) {
						var c, a, e, b;
						c = ";" + document.cookie.replace(/ /g, "") + ";";
						a = ";" + d + "=";
						e = c.indexOf(a);
						if (e != -1) {
							e += a.length;
							b = c.indexOf(";", e);
							return unescape(c.substr(e, b - e))
						}
						return
					},
					delCookie : function(a) {
						document.cookie = a
								+ "=;expires=Fri, 31 Dec 1987 23:59:59 GMT;"
					},
					setOffset : function() {
						var b = nahf.Browser, a = 0, c = 0;
						if (b.ie_sv1) {
							a = 10;
							c = (b.infopath) ? 58 : 29
						} else {
							if (b.ie7) {
								a = 10;
								c = 81
							} else {
								if (b.etc) {
									a = (b.mac) ? 0 : 6;
									c = (b.mac) ? 68 : 54
								} else {
									if (b.ff2) {
										a = (b.mac) ? 0 : 6;
										c = (b.mac) ? 18 : (b.infopath) ? 54
												: 49
									} else {
										if (b.ff3) {
											a = (b.mac) ? 0 : 8;
											c = (b.mac) ? 68
													: (b.infopath) ? 85 : 75
										} else {
											if (b.sf) {
												a = (b.mac) ? 0 : 4;
												c = (b.mac) ? 23 : 27
											} else {
												if (b.ns) {
													a = (b.mac) ? 0 : 6;
													c = (b.mac) ? 18 : 54
												} else {
													if (b.op) {
														a = (b.mac) ? 0 : 9;
														c = (b.mac) ? 36 : 49
													}
												}
											}
										}
									}
								}
							}
						}
						b.offset.width = a;
						b.offset.height = c
					}(),
					resizePop : function(b, d) {
						var a = (typeof (b) == "object") ? b.offsetHeight : d, c = (typeof (b) == "object") ? b.offsetWidth
								: b;
						window.resizeTo(c + nahf.Browser.offset.width, a
								+ nahf.Browser.offset.height)
					},
					popup : function(d, b, f, a) {
						var c = {
							name : "nahfPopup",
							scroll : 0,
							resize : 0,
							status : 0
						}, g, e = function(h) {
							return (h && h != "no") ? "yes" : "no"
						};
						nahf.extend(c, a || {}, true);
						g = "width=" + b + ",height=" + f + ",status="
								+ e(c.status);
						g += ",resizable=" + e(c.resize) + ",scrollbars="
								+ e(c.scroll);
						return window.open(d, c.name, g)
					}
				});
nahf
		.extend(
				nahf.Function,
				{
					callBack : function(e) {
						var d = e, b = nahf.$A(arguments), c, a;
						b.shift();
						c = b.shift();
						return function() {
							b = b.concat(nahf.$A(arguments));
							a = d.apply(null, b);
							c.apply(null, b);
							return a
						}
					},
					callFore : function(d) {
						var c = d, a = nahf.$A(arguments), b;
						a.shift();
						b = a.shift();
						return function() {
							a = a.concat(nahf.$A(arguments));
							b(a);
							return c(a)
						}
					},
					inherit : function(e, d, a) {
						var b = function() {
						}, g;
						b.prototype = d.prototype;
						e.prototype = new b(), e.prototype.constructor = e;
						e.prototype.parent = (d.prototype.parent || [])
								.concat(d);
						e._parent = d;
						g = e.prototype.parent.length;
						e.prototype.$super = function() {
							var c = this.constructor.prototype.parent[--g];
							c.apply(this, arguments);
							g = (g == 0 || (c && c.toString().indexOf(
									"this.$super(") == -1)) ? this.constructor.prototype.parent.length
									: g
						};
						if (a) {
							nahf.Function.members(e, a)
						}
						return e
					},
					members : function(c, d) {
						var b, a = c._parent || c;
						for ( var b in d) {
							c.prototype[b] = (typeof (d[b]) == "function") ? (a.prototype[b]) ? (function(
									e, f) {
								if (f.toString().indexOf("this.$super(") > -1) {
									return function() {
										this.$prev_super = this.$super;
										this.$super = function() {
											this.$super = this.$prev_super;
											return a.prototype[e].apply(this,
													arguments)
										};
										return f.apply(this, arguments)
									}
								}
								return function() {
									return f.apply(this, arguments)
								}
							})(b, d[b])
									: (function(e, f) {
										if (f.toString()
												.indexOf("this.$super(") > -1) {
											throw new Error(
													e
															+ " function is not defined in "
															+ c)
										}
										return function() {
											return f.apply(this, arguments)
										}
									})(b, d[b])
									: d[b]
						}
						return c
					},
					method : function(d, c, a) {
						var b = d._parent || d;
						d.prototype[c] = (typeof (a) == "function") ? (b.prototype[c]) ? (function(
								e, f) {
							return function() {
								this.$super = function() {
									return b.prototype[e]
											.apply(this, arguments)
								};
								return f.apply(this, arguments)
							}
						})(c, a)
								: (function(e, f) {
									return function() {
										this.$super = function() {
											return true
										};
										return f.apply(this, arguments)
									}
								})(c, a)
								: a;
						return d
					}
				});
nahf.createFunction = function(d, a) {
	var c = "return function(", b;
	for (b = 0; b < d.length; b++) {
		c += "" + d[b] + ","
	}
	c = c.replace(/,$/, "");
	c = c + "){" + a + "}";
	return (new Function(c))()
};
nahf
		.extend(
				nahf.Fx,
				{
					running : {},
					parse : function(e, c, d) {
						if (c === "opacity" && nahf.ie) {
							e = e === undefined ? 1 : e
						} else {
							if (e === "transparent" || e.startsWith("rgba")) {
								e = "rgb(255,255,255)"
							} else {
								if (e === "auto") {
									e = nahf.String.px(d["scroll"
											+ c.charAt(0).toUpperCase()
											+ c.substr(1)])
								}
							}
						}
						var a = parseFloat(e), b = e.toString().replace(
								/^\-?[\d\.]+/, "");
						return {
							value : isNaN(a) ? b : a,
							unit : isNaN(a) ? b.startsWith("rgb")
									|| b.startsWith("#") ? "color" : "" : b
						}
					},
					normalize : function(a) {
						var h = {}, g, j = (typeof a === "object") ? "" : a, c, f = document
								.createElement("div"), e = ("borderStyle backgroundColor borderBottomColor borderBottomWidth borderLeftColor borderLeftWidth borderRightColor borderRightWidth borderSpacing borderTopColor borderTopWidth bottom color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex")
								.split(" "), d = e.length, b;
						f.innerHTML = '<div style="' + j + '"></div>';
						c = f.childNodes[0];
						if ("" === j) {
							for (b in a) {
								c.style[b] = a[b].toString()
							}
						}
						while (d--) {
							if (g = c.style[e[d]]) {
								h[e[d]] = this.parse(g, e[d])
							}
						}
						return h
					},
					s : function(b, a, d) {
						return b.substr(a, d || 1)
					},
					stop : function(a, b) {
						clearInterval(this.running[a.id]);
						delete nahf.Fx.running[a.id];
						b && b(a);
						a.id = a.id.toString().startsWith("__t") ? "" : a.id
					},
					color : function(b, g, k) {
						var e = 2, d, h, f, l = [], a = [];
						while (d = 3, h = arguments[e - 1], e--) {
							if (this.s(h, 0) === "r") {
								h = h.match(/\d+/g);
								while (d--) {
									l.push(~~h[d])
								}
							} else {
								if (h.length === 4) {
									h = "#" + this.s(h, 1) + this.s(h, 1)
											+ this.s(h, 2) + this.s(h, 2)
											+ this.s(h, 3) + this.s(h, 3)
								}
								while (d--) {
									l
											.push(parseInt(this.s(h, 1 + d * 2,
													2), 16))
								}
							}
						}
						while (d--) {
							f = ~~(l[d + 3] + (l[d] - l[d + 3]) * k);
							a.push(f < 0 ? 0 : f > 255 ? 255 : f)
						}
						return "rgb(" + a.join(",") + ")"
					},
					animate : function(g, m, n) {
						var f = nahf.$(g), a = n || {}, j = this.normalize(m), h = f.currentStyle ? f.currentStyle
								: getComputedStyle(f, null), c, i = {}, d = +new Date, b = (a.duration
								&& a.duration <= 10 ? a.duration * 1000
								: a.duration) || 700, l = d + b, e, k = a.easing
								|| function(p, o, r, q) {
									return -r * (p /= q) * (p - 2) + o
								};
						f.id = (!f.id) ? "__t" + +new Date
								+ nahf.random(1, 10000) : f.id;
						if (nahf.ie6) {
							f.style.zoom = "1"
						}
						if (this.running[f.id]) {
							clearInterval(this.running[f.id]);
							delete nahf.Fx.running[f.id]
						}
						for (c in j) {
							i[c] = this.parse(h[c], c, f)
						}
						if (nahf.toJSON(i) === nahf.toJSON(j)) {
							this.stop(f, a.callback);
							return
						}
						e = setInterval(
								function() {
									var p = +new Date;
									for (c in j) {
										try {
											f.style[c] = j[c].unit === "color" ? nahf.Fx
													.color(i[c].value,
															j[c].value, k(
																	p - d, 0,
																	1, b))
													: k(
															p - d,
															i[c].value,
															j[c].value
																	- i[c].value,
															b).toFixed(3)
															+ j[c].unit
										} catch (o) {
											f.style[c] = j[c].value;
											delete j[c]
										}
										if (c === "opacity" && nahf.ie) {
											f.style.filter = "alpha(opacity="
													+ f.style[c] * 100 + ")"
										}
									}
									if (p > l) {
										for (c in j) {
											f.style[c] = j[c].unit === "color" ? nahf.Fx
													.color(i[c].value,
															j[c].value, 1)
													: j[c].value + j[c].unit
										}
										this.stop(f, a.callback)
									}
								}.bind(this), 13);
						this.running[f.id] = e
					},
					scrollTo : function(e, k) {
						var d = nahf.$E(e), a = k || {}, f = (nahf.ie) ? document.documentElement.scrollTop
								: window.pageYOffset, c = +new Date, h = d
								.getCoords()["top"]
								+ ((a.offset) ? a.offset : 0), b = a.duration || 700, i = c
								+ b, g = a.easing || function(m, l, o, n) {
							return -o * (m /= n) * (m - 2) + l
						}, j = setInterval(function() {
							var l = +new Date;
							window.scrollTo(0, g(l - c, f, h - f, b));
							if (l > i) {
								window.scrollTo(0, h);
								clearInterval(j)
							}
						}, 13)
					}
				});
nahf
		.extend(
				nahf.Element,
				{
					setLeft : function(a, c, b) {
						return nahf.Element.setStyleProperty(a, "left", c, b)
					},
					setTop : function(a, c, b) {
						return nahf.Element.setStyleProperty(a, "top", c, b)
					},
					setWidth : function(b, a, c) {
						return nahf.Element.setStyleProperty(b, "width", a, c)
					},
					setHeight : function(b, a, c) {
						return nahf.Element.setStyleProperty(b, "height", a, c)
					},
					setPosition : function(a, c, d, b) {
						nahf.Element.setStyleProperty(a, "left", c, b);
						return nahf.Element.setStyleProperty(a, "top", d, b)
					},
					setSize : function(c, a, b, d) {
						nahf.Element.setStyleProperty(c, "width", a, d);
						return nahf.Element.setStyleProperty(c, "height", b, d)
					},
					setStyleProperty : function(b, a, g, d) {
						var f = nahf.$(b), c;
						if (d || false) {
							c = (isNaN(parseInt(f.style[a]))) ? parseInt(f["offset"
									+ (a.replace(/^(.)/g, function(h, e) {
										return e.toUpperCase()
									}))])
									+ g
									: parseInt(f.style[a]) + g
						} else {
							c = g
						}
						f.style[a] = nahf.String.px(c);
						return f
					},
					setLeftByOffset : function(a, b) {
						return nahf.Element.setLeft(a, b, true)
					},
					setTopByOffset : function(a, b) {
						return nahf.Element.setTop(a, b, true)
					},
					setWidthByOffset : function(a, b) {
						return nahf.Element.setWidth(a, b, true)
					},
					setHeightByOffset : function(a, b) {
						return nahf.Element.setHeight(a, b, true)
					},
					setPositionByOffset : function(b, a, c) {
						return nahf.Element.setPosition(b, a, c, true)
					},
					setSizeByOffset : function(b, a, c) {
						return nahf.Element.setSize(b, a, c, true)
					},
					posHide : function(a) {
						var b = nahf.$(a);
						nahf.Element.setPosition(b, -10000, -10000);
						return b
					},
					setCssText : function() {
						return (nahf.Browser.ie) ? function(b, a) {
							b.style.cssText = a
						} : function(b, a) {
							b.setAttribute("style", a)
						}
					}(),
					setPngOpacity : function() {
						if (nahf.Browser.ie6) {
							return function(a, c, d) {
								var b = nahf.$(a);
								b.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'
										+ c
										+ '", sizingMethod="'
										+ (d || "image") + '")';
								if (b.style.background != "") {
									b.style.background = "none"
								}
								if (b.tagName.toLowerCase() == "img") {
									b.src = "http://i1.nahfcdn.net/imap/defaultimg/transparent.gif"
								}
							}
						} else {
							return function(b, d, f) {
								var a = (f == "scale") ? "repeat" : "no-repeat", c = nahf
										.$(b);
								if (c.tagName.toLowerCase() != "img") {
									c.style.background = "url(" + d + ") " + a
								} else {
									c.src = d
								}
							}
						}
					}(),
					setStyle : function(c, d, b) {
						if (b) {
							return nahf.Element
									.setStyleProperty(c, d, b, false)
						}
						var g = nahf.$(c), a = g.style, f;
						if (d.length < 1) {
							return g
						}
						if (nahf.Object.isString(d)) {
							a.cssText += ";" + d
						} else {
							if (nahf.Object.isObject(d)) {
								for (f in d) {
									a[(f == "float" || f == "cssFloat") ? (undefined == a.styleFloat ? "cssFloat"
											: "styleFloat")
											: f] = d[f]
								}
							}
						}
						return g
					},
					destroy : function(b) {
						var a = "__nahfGB", d = nahf.$(a), c = nahf.$(b);
						if (c.id === a) {
							return
						}
						if (!d) {
							d = nahf.createElement("div", {
								id : a,
								style : "display:none;"
							});
							document.body.appendChild(d)
						}
						d.appendChild(c);
						d.innerHTML = "";
						c = null
					}
				});
nahf.extend(nahf.Event, {
	getWheel : function(a) {
		var b = a || window.event, c = 0;
		if (b.wheelDelta) {
			c = b.wheelDelta / 120
		} else {
			if (b.detail) {
				c = -b.detail / 3
			}
		}
		return c
	},
	getMouseButton : function(b) {
		var c = b || window.event, a = c.button;
		return {
			left : (nahf.Browser.ie) ? a === 1 : a === 0,
			middle : (nahf.Browser.ie) ? a === 4 : a === 1,
			right : a == 2
		}
	},
	getElement : function(a) {
		var b = a || window.event;
		return b.srcElement || b.target
	}
});
nahf.extend(nahf.Number, {
	px : function(a) {
		return nahf.String.px(a)
	},
	fillZero : function(e, a) {
		var d = a || 0, b = e.toString();
		if (d < b.length) {
			return b
		}
		while (b.length < d) {
			b = "0" + b
		}
		return b
	},
	toInt : function(b, a) {
		return nahf.String.toInt(b, a)
	},
	toFloat : function(a) {
		return nahf.String.toFloat(a)
	}
});
nahf.extend(nahf.String, {
	empty : function(a) {
		return nahf.String.isEmpty(a)
	},
	isEmpty : function(a) {
		return (!a || a.length === 0)
	},
	px : function(b) {
		var a = parseInt(b);
		return (!isNaN(a)) ? a + "px" : b
	},
	removeCR : function(a) {
		return (a) ? nahf.String.replaceAll(a, /\n|\r/, "") : null
	},
	toInt : function(b, a) {
		return parseInt(b, a || 10)
	},
	toFloat : function(a) {
		return parseFloat(a)
	},
	startWith : function(b, a) {
		return nahf.String.startsWith(b, a)
	},
	startsWith : function(b, a) {
		return b.indexOf(a) === 0
	},
	endWith : function(b, a) {
		return nahf.String.endsWith(b, a)
	},
	endsWith : function(b, c) {
		var a;
		return (a = b.length - c.length) >= 0 && b.lastIndexOf(c) === a
	},
	cutPixel : function(c, f, e) {
		if (!nahf.documentLoaded) {
			return false
		}
		var a = e || "", d, g, b;
		document.body.appendChild(nahf.HTMLPrototype);
		nahf.HTMLPrototype.innerHTML = a;
		d = nahf.HTMLPrototype.offsetWidth;
		f -= d;
		nahf.HTMLPrototype.innerHTML = "";
		g = [];
		for (b = 0; b < c.length; b += 1) {
			nahf.HTMLPrototype.innerHTML += c.charAt(b);
			if (f > nahf.HTMLPrototype.offsetWidth) {
				g.push(c.charAt(b))
			} else {
				g.push(a);
				break
			}
		}
		nahf.HTMLFragment.appendChild(nahf.HTMLPrototype);
		return g.join("")
	},
	escape : function(b, a) {
		return (a) ? nahf.String.escapeHTML(b) : nahf.String.unescapeHTML(b)
	},
	escapeHTML : function(a) {
		return a.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g,
				"&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;")
	},
	unescapeHTML : function(a) {
		return nahf.String.stripTags(a).replace(/&lt;/g, "<").replace(/&gt;/g,
				">").replace(/&amp;/g, "&").replace(/&quot;/g, '"').replace(
				/&#39;/g, "'")
	},
	toHTML : function(a) {
		return nahf.String.unescapeHTML(a)
	},
	stripTags : function(a) {
		return a.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi, "")
	},
	stripTag : function(a) {
		return nahf.String.stripTags(a)
	}
});
nahf.Ajax = function(a) {
	this.options = {
		url : "",
		method : "get",
		async : true,
		timeout : 5000,
		paramString : "",
		encoding : "utf-8",
		onsuccess : function() {
		},
		onfailure : function() {
		},
		onloading : function() {
		},
		ontimeout : function() {
		},
		onabort : function() {
		},
		headers : {},
		link : "ignore"
	};
	nahf.extend(this.options, a || {});
	this.init()
};
nahf.Ajax.prototype = {
	init : function() {
		if (window.XMLHttpRequest) {
			this.XHR = new XMLHttpRequest()
		} else {
			if (window.ActiveXObject) {
				try {
					this.XHR = new ActiveXObject("Msxml2.XMLHTTP")
				} catch (a) {
					try {
						this.XHR = new ActiveXObject("Microsoft.XMLHTTP")
					} catch (a) {
						this.XHR = null
					}
				}
			}
		}
		if (!this.XHR) {
			return false
		}
		this.running = false
	},
	request : function(c, b) {
		if (this.running) {
			if (this.options.link === "cancel") {
				this.abort()
			} else {
				return
			}
		}
		this.setOptions(b);
		var a = c || this.options.url;
		if (this.options.paramString.length > 0 && this.options.method == "get") {
			a = a + ((a.indexOf("?") > 0) ? "&" : "?")
					+ this.options.paramString
		}
		this.open(a)
	},
	open : function(b) {
		this.running = true;
		if (this.options.async) {
			this.XHR.onreadystatechange = nahf.Function.bindAsEventListener(
					this.stateHandle, this)
		}
		this.options.timer = nahf.Function.timeout(this.abort,
				this.options.timeout, this);
		this.XHR.open(this.options.method, b, this.options.async);
		var c = this.options.headers;
		for ( var a in c) {
			this.XHR.setRequestHeader(a, c[a])
		}
		this.XHR.send(this.options.paramString);
		if (!this.options.async) {
			this.stateHandle()
		}
	},
	abort : function() {
		if (this.XHR) {
			this.XHR.abort();
			this.callAbort();
			this.running = false
		}
	},
	stateHandle : function(a) {
		switch (this.XHR.readyState) {
		case 4:
			window.clearTimeout(this.options.timer);
			this.options.timer = null;
			if (this.XHR.status == 200 || this.XHR.status == 304) {
				this.callSuccess()
			} else {
				if (this.XHR.status >= 400) {
					this.callFailure(this.XHR.status)
				}
			}
			this.running = false;
			break;
		case 1:
			this.callLoading();
			break
		}
	},
	callSuccess : function() {
		this.options.onsuccess(this.XHR)
	},
	callFailure : function() {
		this.options.onfailure(this.XHR)
	},
	callLoading : function() {
		this.options.onloading(this.XHR)
	},
	callTimeout : function() {
		this.options.ontimeout(this.XHR)
	},
	callAbort : function() {
		this.options.onabort(this.XHR)
	},
	setOptions : function(a) {
		nahf.extend(this.options, a || {});
		this.options.method = this.options.method.toLowerCase();
		this.setHeader("charset", this.options.encoding);
		if (this.options.method == "post") {
			this.setHeader("Content-Type", "application/x-www-form-urlencoded")
		}
	},
	setHeader : function(a, b) {
		if (typeof a === "object") {
			nahf.extend(this.options.headers, a || {}, true)
		} else {
			this.options.headers[a] = b
		}
		return this
	},
	getHeader : function(a) {
		return this.XHR.getResponseHeader(a)
	}
};
nahf.Ajax.xmlToObject = function(a) {
	return nahf.xmlToObject(a)
};
nahf.Ajax.jsonToObject = function(a) {
	return nahf.jsonToObject(a)
};
nahf.Template = function(a) {
	this.template = a
};
nahf.Template.prototype = {
	evaluate : function(a) {
		return this.template.replace(
				/#\{([A-Z_][\dA-Z_]*(?:\.[A-Z_][\dA-Z_]*)*)?\}/ig, function(d,
						e) {
					var b = e ? e.split(".") : "";
					var c = a || "";
					while (b.length) {
						c = c[b.shift()];
						if (c === undefined || c === null) {
							return ""
						}
					}
					return c
				})
	},
	toElement : function(a) {
		return nahf.createElement(this.evaluate(a))
	}
};
/*
 * ! Sizzle CSS Selector Engine - v1.0 Copyright 2009, The Dojo Foundation
 * Released under the MIT, BSD, and GPL Licenses. More information:
 * http://sizzlejs.com/
 */
(function() {
	var p = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g, i = 0, d = Object.prototype.toString, n = false;
	var b = function(D, t, A, v) {
		A = A || [];
		var e = t = t || document;
		if (t.nodeType !== 1 && t.nodeType !== 9) {
			return []
		}
		if (!D || typeof D !== "string") {
			return A
		}
		var B = [], C, y, G, F, z, s, r = true, w = o(t);
		p.lastIndex = 0;
		while ((C = p.exec(D)) !== null) {
			B.push(C[1]);
			if (C[2]) {
				s = RegExp.rightContext;
				break
			}
		}
		if (B.length > 1 && j.exec(D)) {
			if (B.length === 2 && f.relative[B[0]]) {
				y = g(B[0] + B[1], t)
			} else {
				y = f.relative[B[0]] ? [ t ] : b(B.shift(), t);
				while (B.length) {
					D = B.shift();
					if (f.relative[D]) {
						D += B.shift()
					}
					y = g(D, y)
				}
			}
		} else {
			if (!v && B.length > 1 && t.nodeType === 9 && !w
					&& f.match.ID.test(B[0])
					&& !f.match.ID.test(B[B.length - 1])) {
				var H = b.find(B.shift(), t, w);
				t = H.expr ? b.filter(H.expr, H.set)[0] : H.set[0]
			}
			if (t) {
				var H = v ? {
					expr : B.pop(),
					set : a(v)
				} : b.find(B.pop(),
						B.length === 1 && (B[0] === "~" || B[0] === "+")
								&& t.parentNode ? t.parentNode : t, w);
				y = H.expr ? b.filter(H.expr, H.set) : H.set;
				if (B.length > 0) {
					G = a(y)
				} else {
					r = false
				}
				while (B.length) {
					var u = B.pop(), x = u;
					if (!f.relative[u]) {
						u = ""
					} else {
						x = B.pop()
					}
					if (x == null) {
						x = t
					}
					f.relative[u](G, x, w)
				}
			} else {
				G = B = []
			}
		}
		if (!G) {
			G = y
		}
		if (!G) {
			throw "Syntax error, unrecognized expression: " + (u || D)
		}
		if (d.call(G) === "[object Array]") {
			if (!r) {
				A.push.apply(A, G)
			} else {
				if (t && t.nodeType === 1) {
					for ( var E = 0; G[E] != null; E++) {
						if (G[E]
								&& (G[E] === true || G[E].nodeType === 1
										&& h(t, G[E]))) {
							A.push(y[E])
						}
					}
				} else {
					for ( var E = 0; G[E] != null; E++) {
						if (G[E] && G[E].nodeType === 1) {
							A.push(y[E])
						}
					}
				}
			}
		} else {
			a(G, A)
		}
		if (s) {
			b(s, e, A, v);
			b.uniqueSort(A)
		}
		return A
	};
	b.uniqueSort = function(r) {
		if (c) {
			n = false;
			r.sort(c);
			if (n) {
				for ( var e = 1; e < r.length; e++) {
					if (r[e] === r[e - 1]) {
						r.splice(e--, 1)
					}
				}
			}
		}
		return r
	};
	b.matches = function(e, r) {
		return b(e, null, null, r)
	};
	b.find = function(x, e, y) {
		var w, u;
		if (!x) {
			return []
		}
		for ( var t = 0, s = f.order.length; t < s; t++) {
			var v = f.order[t], u;
			if ((u = f.match[v].exec(x))) {
				var r = RegExp.leftContext;
				if (r.substr(r.length - 1) !== "\\") {
					u[1] = (u[1] || "").replace(/\\/g, "");
					w = f.find[v](u, e, y);
					if (w != null) {
						x = x.replace(f.match[v], "");
						break
					}
				}
			}
		}
		if (!w) {
			w = e.getElementsByTagName("*")
		}
		return {
			set : w,
			expr : x
		}
	};
	b.filter = function(A, z, D, t) {
		var s = A, F = [], x = z, v, e, w = z && z[0] && o(z[0]);
		while (A && z.length) {
			for ( var y in f.filter) {
				if ((v = f.match[y].exec(A)) != null) {
					var r = f.filter[y], E, C;
					e = false;
					if (x == F) {
						F = []
					}
					if (f.preFilter[y]) {
						v = f.preFilter[y](v, x, D, F, t, w);
						if (!v) {
							e = E = true
						} else {
							if (v === true) {
								continue
							}
						}
					}
					if (v) {
						for ( var u = 0; (C = x[u]) != null; u++) {
							if (C) {
								E = r(C, v, u, x);
								var B = t ^ !!E;
								if (D && E != null) {
									if (B) {
										e = true
									} else {
										x[u] = false
									}
								} else {
									if (B) {
										F.push(C);
										e = true
									}
								}
							}
						}
					}
					if (E !== undefined) {
						if (!D) {
							x = F
						}
						A = A.replace(f.match[y], "");
						if (!e) {
							return []
						}
						break
					}
				}
			}
			if (A == s) {
				if (e == null) {
					throw "Syntax error, unrecognized expression: " + A
				} else {
					break
				}
			}
			s = A
		}
		return x
	};
	var f = b.selectors = {
		order : [ "ID", "NAME", "TAG" ],
		match : {
			ID : /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
			CLASS : /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
			NAME : /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,
			ATTR : /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
			TAG : /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,
			CHILD : /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
			POS : /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
			PSEUDO : /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/
		},
		attrMap : {
			"class" : "className",
			"for" : "htmlFor"
		},
		attrHandle : {
			href : function(e) {
				return e.getAttribute("href")
			}
		},
		relative : {
			"+" : function(x, e, w) {
				var u = typeof e === "string", y = u && !/\W/.test(e), v = u
						&& !y;
				if (y && !w) {
					e = e.toUpperCase()
				}
				for ( var t = 0, s = x.length, r; t < s; t++) {
					if ((r = x[t])) {
						while ((r = r.previousSibling) && r.nodeType !== 1) {
						}
						x[t] = v || r && r.nodeName === e ? r || false
								: r === e
					}
				}
				if (v) {
					b.filter(e, x, true)
				}
			},
			">" : function(w, r, x) {
				var u = typeof r === "string";
				if (u && !/\W/.test(r)) {
					r = x ? r : r.toUpperCase();
					for ( var s = 0, e = w.length; s < e; s++) {
						var v = w[s];
						if (v) {
							var t = v.parentNode;
							w[s] = t.nodeName === r ? t : false
						}
					}
				} else {
					for ( var s = 0, e = w.length; s < e; s++) {
						var v = w[s];
						if (v) {
							w[s] = u ? v.parentNode : v.parentNode === r
						}
					}
					if (u) {
						b.filter(r, w, true)
					}
				}
			},
			"" : function(t, r, v) {
				var s = i++, e = q;
				if (!/\W/.test(r)) {
					var u = r = v ? r : r.toUpperCase();
					e = m
				}
				e("parentNode", r, s, t, u, v)
			},
			"~" : function(t, r, v) {
				var s = i++, e = q;
				if (typeof r === "string" && !/\W/.test(r)) {
					var u = r = v ? r : r.toUpperCase();
					e = m
				}
				e("previousSibling", r, s, t, u, v)
			}
		},
		find : {
			ID : function(r, s, t) {
				if (typeof s.getElementById !== "undefined" && !t) {
					var e = s.getElementById(r[1]);
					return e ? [ e ] : []
				}
			},
			NAME : function(s, v, w) {
				if (typeof v.getElementsByName !== "undefined") {
					var r = [], u = v.getElementsByName(s[1]);
					for ( var t = 0, e = u.length; t < e; t++) {
						if (u[t].getAttribute("name") === s[1]) {
							r.push(u[t])
						}
					}
					return r.length === 0 ? null : r
				}
			},
			TAG : function(e, r) {
				return r.getElementsByTagName(e[1])
			}
		},
		preFilter : {
			CLASS : function(t, r, s, e, w, x) {
				t = " " + t[1].replace(/\\/g, "") + " ";
				if (x) {
					return t
				}
				for ( var u = 0, v; (v = r[u]) != null; u++) {
					if (v) {
						if (w
								^ (v.className && (" " + v.className + " ")
										.indexOf(t) >= 0)) {
							if (!s) {
								e.push(v)
							}
						} else {
							if (s) {
								r[u] = false
							}
						}
					}
				}
				return false
			},
			ID : function(e) {
				return e[1].replace(/\\/g, "")
			},
			TAG : function(r, e) {
				for ( var s = 0; e[s] === false; s++) {
				}
				return e[s] && o(e[s]) ? r[1] : r[1].toUpperCase()
			},
			CHILD : function(e) {
				if (e[1] == "nth") {
					var r = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2] == "even"
							&& "2n" || e[2] == "odd" && "2n+1"
							|| !/\D/.test(e[2]) && "0n+" + e[2] || e[2]);
					e[2] = (r[1] + (r[2] || 1)) - 0;
					e[3] = r[3] - 0
				}
				e[0] = i++;
				return e
			},
			ATTR : function(u, r, s, e, v, w) {
				var t = u[1].replace(/\\/g, "");
				if (!w && f.attrMap[t]) {
					u[1] = f.attrMap[t]
				}
				if (u[2] === "~=") {
					u[4] = " " + u[4] + " "
				}
				return u
			},
			PSEUDO : function(u, r, s, e, v) {
				if (u[1] === "not") {
					if (p.exec(u[3]).length > 1 || /^\w/.test(u[3])) {
						u[3] = b(u[3], null, null, r)
					} else {
						var t = b.filter(u[3], r, s, true ^ v);
						if (!s) {
							e.push.apply(e, t)
						}
						return false
					}
				} else {
					if (f.match.POS.test(u[0]) || f.match.CHILD.test(u[0])) {
						return true
					}
				}
				return u
			},
			POS : function(e) {
				e.unshift(true);
				return e
			}
		},
		filters : {
			enabled : function(e) {
				return e.disabled === false && e.type !== "hidden"
			},
			disabled : function(e) {
				return e.disabled === true
			},
			checked : function(e) {
				return e.checked === true
			},
			selected : function(e) {
				e.parentNode.selectedIndex;
				return e.selected === true
			},
			parent : function(e) {
				return !!e.firstChild
			},
			empty : function(e) {
				return !e.firstChild
			},
			has : function(s, r, e) {
				return !!b(e[3], s).length
			},
			header : function(e) {
				return /h\d/i.test(e.nodeName)
			},
			text : function(e) {
				return "text" === e.type
			},
			radio : function(e) {
				return "radio" === e.type
			},
			checkbox : function(e) {
				return "checkbox" === e.type
			},
			file : function(e) {
				return "file" === e.type
			},
			password : function(e) {
				return "password" === e.type
			},
			submit : function(e) {
				return "submit" === e.type
			},
			image : function(e) {
				return "image" === e.type
			},
			reset : function(e) {
				return "reset" === e.type
			},
			button : function(e) {
				return "button" === e.type
						|| e.nodeName.toUpperCase() === "BUTTON"
			},
			input : function(e) {
				return /input|select|textarea|button/i.test(e.nodeName)
			}
		},
		setFilters : {
			first : function(r, e) {
				return e === 0
			},
			last : function(s, r, e, t) {
				return r === t.length - 1
			},
			even : function(r, e) {
				return e % 2 === 0
			},
			odd : function(r, e) {
				return e % 2 === 1
			},
			lt : function(s, r, e) {
				return r < e[3] - 0
			},
			gt : function(s, r, e) {
				return r > e[3] - 0
			},
			nth : function(s, r, e) {
				return e[3] - 0 == r
			},
			eq : function(s, r, e) {
				return e[3] - 0 == r
			}
		},
		filter : {
			PSEUDO : function(w, s, t, x) {
				var r = s[1], u = f.filters[r];
				if (u) {
					return u(w, t, s, x)
				} else {
					if (r === "contains") {
						return (w.textContent || w.innerText || "")
								.indexOf(s[3]) >= 0
					} else {
						if (r === "not") {
							var v = s[3];
							for ( var t = 0, e = v.length; t < e; t++) {
								if (v[t] === w) {
									return false
								}
							}
							return true
						}
					}
				}
			},
			CHILD : function(e, t) {
				var w = t[1], r = e;
				switch (w) {
				case "only":
				case "first":
					while ((r = r.previousSibling)) {
						if (r.nodeType === 1) {
							return false
						}
					}
					if (w == "first") {
						return true
					}
					r = e;
				case "last":
					while ((r = r.nextSibling)) {
						if (r.nodeType === 1) {
							return false
						}
					}
					return true;
				case "nth":
					var s = t[2], z = t[3];
					if (s == 1 && z == 0) {
						return true
					}
					var v = t[0], y = e.parentNode;
					if (y && (y.sizcache !== v || !e.nodeIndex)) {
						var u = 0;
						for (r = y.firstChild; r; r = r.nextSibling) {
							if (r.nodeType === 1) {
								r.nodeIndex = ++u
							}
						}
						y.sizcache = v
					}
					var x = e.nodeIndex - z;
					if (s == 0) {
						return x == 0
					} else {
						return (x % s == 0 && x / s >= 0)
					}
				}
			},
			ID : function(r, e) {
				return r.nodeType === 1 && r.getAttribute("id") === e
			},
			TAG : function(r, e) {
				return (e === "*" && r.nodeType === 1) || r.nodeName === e
			},
			CLASS : function(r, e) {
				return (" " + (r.className || r.getAttribute("class")) + " ")
						.indexOf(e) > -1
			},
			ATTR : function(v, t) {
				var s = t[1], e = f.attrHandle[s] ? f.attrHandle[s](v)
						: v[s] != null ? v[s] : v.getAttribute(s), w = e + "", u = t[2], r = t[4];
				return e == null ? u === "!="
						: u === "=" ? w === r
								: u === "*=" ? w.indexOf(r) >= 0
										: u === "~=" ? (" " + w + " ")
												.indexOf(r) >= 0
												: !r ? w && e !== false
														: u === "!=" ? w != r
																: u === "^=" ? w
																		.indexOf(r) === 0
																		: u === "$=" ? w
																				.substr(w.length
																						- r.length) === r
																				: u === "|=" ? w === r
																						|| w
																								.substr(
																										0,
																										r.length + 1) === r
																								+ "-"
																						: false
			},
			POS : function(u, r, s, v) {
				var e = r[2], t = f.setFilters[e];
				if (t) {
					return t(u, s, r, v)
				}
			}
		}
	};
	var j = f.match.POS;
	for ( var l in f.match) {
		f.match[l] = new RegExp(f.match[l].source
				+ /(?![^\[]*\])(?![^\(]*\))/.source)
	}
	var a = function(r, e) {
		r = Array.prototype.slice.call(r, 0);
		if (e) {
			e.push.apply(e, r);
			return e
		}
		return r
	};
	try {
		Array.prototype.slice.call(document.documentElement.childNodes, 0)
	} catch (k) {
		a = function(u, t) {
			var r = t || [];
			if (d.call(u) === "[object Array]") {
				Array.prototype.push.apply(r, u)
			} else {
				if (typeof u.length === "number") {
					for ( var s = 0, e = u.length; s < e; s++) {
						r.push(u[s])
					}
				} else {
					for ( var s = 0; u[s]; s++) {
						r.push(u[s])
					}
				}
			}
			return r
		}
	}
	var c;
	if (document.documentElement.compareDocumentPosition) {
		c = function(r, e) {
			if (!r.compareDocumentPosition || !e.compareDocumentPosition) {
				if (r == e) {
					n = true
				}
				return 0
			}
			var s = r.compareDocumentPosition(e) & 4 ? -1 : r === e ? 0 : 1;
			if (s === 0) {
				n = true
			}
			return s
		}
	} else {
		if ("sourceIndex" in document.documentElement) {
			c = function(r, e) {
				if (!r.sourceIndex || !e.sourceIndex) {
					if (r == e) {
						n = true
					}
					return 0
				}
				var s = r.sourceIndex - e.sourceIndex;
				if (s === 0) {
					n = true
				}
				return s
			}
		} else {
			if (document.createRange) {
				c = function(t, r) {
					if (!t.ownerDocument || !r.ownerDocument) {
						if (t == r) {
							n = true
						}
						return 0
					}
					var s = t.ownerDocument.createRange(), e = r.ownerDocument
							.createRange();
					s.selectNode(t);
					s.collapse(true);
					e.selectNode(r);
					e.collapse(true);
					var u = s.compareBoundaryPoints(Range.START_TO_END, e);
					if (u === 0) {
						n = true
					}
					return u
				}
			}
		}
	}
	(function() {
		var r = document.createElement("div"), s = "script"
				+ (new Date).getTime();
		r.innerHTML = "<a name='" + s + "'/>";
		var e = document.documentElement;
		e.insertBefore(r, e.firstChild);
		if (!!document.getElementById(s)) {
			f.find.ID = function(u, v, w) {
				if (typeof v.getElementById !== "undefined" && !w) {
					var t = v.getElementById(u[1]);
					return t ? t.id === u[1]
							|| typeof t.getAttributeNode !== "undefined"
							&& t.getAttributeNode("id").nodeValue === u[1] ? [ t ]
							: undefined
							: []
				}
			};
			f.filter.ID = function(v, t) {
				var u = typeof v.getAttributeNode !== "undefined"
						&& v.getAttributeNode("id");
				return v.nodeType === 1 && u && u.nodeValue === t
			}
		}
		e.removeChild(r);
		e = r = null
	})();
	(function() {
		var e = document.createElement("div");
		e.appendChild(document.createComment(""));
		if (e.getElementsByTagName("*").length > 0) {
			f.find.TAG = function(r, v) {
				var u = v.getElementsByTagName(r[1]);
				if (r[1] === "*") {
					var t = [];
					for ( var s = 0; u[s]; s++) {
						if (u[s].nodeType === 1) {
							t.push(u[s])
						}
					}
					u = t
				}
				return u
			}
		}
		e.innerHTML = "<a href='#'></a>";
		if (e.firstChild && typeof e.firstChild.getAttribute !== "undefined"
				&& e.firstChild.getAttribute("href") !== "#") {
			f.attrHandle.href = function(r) {
				return r.getAttribute("href", 2)
			}
		}
		e = null
	})();
	if (document.querySelectorAll) {
		(function() {
			var e = b, s = document.createElement("div");
			s.innerHTML = "<p class='TEST'></p>";
			if (s.querySelectorAll && s.querySelectorAll(".TEST").length === 0) {
				return
			}
			b = function(w, v, t, u) {
				v = v || document;
				if (!u && v.nodeType === 9 && !o(v)) {
					try {
						return a(v.querySelectorAll(w), t)
					} catch (x) {
					}
				}
				return e(w, v, t, u)
			};
			for ( var r in e) {
				b[r] = e[r]
			}
			s = null
		})()
	}
	if (document.getElementsByClassName
			&& document.documentElement.getElementsByClassName) {
		(function() {
			var e = document.createElement("div");
			e.innerHTML = "<div class='test e'></div><div class='test'></div>";
			if (e.getElementsByClassName("e").length === 0) {
				return
			}
			e.lastChild.className = "e";
			if (e.getElementsByClassName("e").length === 1) {
				return
			}
			f.order.splice(1, 0, "CLASS");
			f.find.CLASS = function(r, s, t) {
				if (typeof s.getElementsByClassName !== "undefined" && !t) {
					return s.getElementsByClassName(r[1])
				}
			};
			e = null
		})()
	}
	function m(r, w, v, A, x, z) {
		var y = r == "previousSibling" && !z;
		for ( var t = 0, s = A.length; t < s; t++) {
			var e = A[t];
			if (e) {
				if (y && e.nodeType === 1) {
					e.sizcache = v;
					e.sizset = t
				}
				e = e[r];
				var u = false;
				while (e) {
					if (e.sizcache === v) {
						u = A[e.sizset];
						break
					}
					if (e.nodeType === 1 && !z) {
						e.sizcache = v;
						e.sizset = t
					}
					if (e.nodeName === w) {
						u = e;
						break
					}
					e = e[r]
				}
				A[t] = u
			}
		}
	}
	function q(r, w, v, A, x, z) {
		var y = r == "previousSibling" && !z;
		for ( var t = 0, s = A.length; t < s; t++) {
			var e = A[t];
			if (e) {
				if (y && e.nodeType === 1) {
					e.sizcache = v;
					e.sizset = t
				}
				e = e[r];
				var u = false;
				while (e) {
					if (e.sizcache === v) {
						u = A[e.sizset];
						break
					}
					if (e.nodeType === 1) {
						if (!z) {
							e.sizcache = v;
							e.sizset = t
						}
						if (typeof w !== "string") {
							if (e === w) {
								u = true;
								break
							}
						} else {
							if (b.filter(w, [ e ]).length > 0) {
								u = e;
								break
							}
						}
					}
					e = e[r]
				}
				A[t] = u
			}
		}
	}
	var h = document.compareDocumentPosition ? function(r, e) {
		return r.compareDocumentPosition(e) & 16
	} : function(r, e) {
		return r !== e && (r.contains ? r.contains(e) : true)
	};
	var o = function(e) {
		return e.nodeType === 9 && e.documentElement.nodeName !== "HTML"
				|| !!e.ownerDocument
				&& e.ownerDocument.documentElement.nodeName !== "HTML"
	};
	var g = function(e, x) {
		var t = [], u = "", v, s = x.nodeType ? [ x ] : x;
		while ((v = f.match.PSEUDO.exec(e))) {
			u += v[0];
			e = e.replace(f.match.PSEUDO, "")
		}
		e = f.relative[e] ? e + "*" : e;
		for ( var w = 0, r = s.length; w < r; w++) {
			b(e, s[w], t)
		}
		return b.filter(u, t)
	};
	window.Sizzle = b
})();
if (!nahf.Browser.webkit) {
	JSON = undefined
}
if (!this.JSON) {
	this.JSON = {}
}
(function() {
	function f(n) {
		return n < 10 ? "0" + n : n
	}
	if (typeof Date.prototype.toJSON !== "function") {
		Date.prototype.toJSON = function(key) {
			return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-"
					+ f(this.getUTCMonth() + 1) + "-" + f(this.getUTCDate())
					+ "T" + f(this.getUTCHours()) + ":"
					+ f(this.getUTCMinutes()) + ":" + f(this.getUTCSeconds())
					+ "Z" : null
		};
		String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function(
				key) {
			return this.valueOf()
		}
	}
	var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, gap, indent, meta = {
		"\b" : "\\b",
		"\t" : "\\t",
		"\n" : "\\n",
		"\f" : "\\f",
		"\r" : "\\r",
		'"' : '\\"',
		"\\" : "\\\\"
	}, rep;
	function quote(string) {
		escapable.lastIndex = 0;
		return escapable.test(string) ? '"'
				+ string.replace(escapable, function(a) {
					var c = meta[a];
					return typeof c === "string" ? c : "\\u"
							+ ("0000" + a.charCodeAt(0).toString(16)).slice(-4)
				}) + '"' : '"' + string + '"'
	}
	function str(key, holder) {
		var i, k, v, length, mind = gap, partial, value = holder[key];
		if (value && typeof value === "object"
				&& typeof value.toJSON === "function") {
			value = value.toJSON(key)
		}
		if (typeof rep === "function") {
			value = rep.call(holder, key, value)
		}
		switch (typeof value) {
		case "string":
			return quote(value);
		case "number":
			return isFinite(value) ? String(value) : "null";
		case "boolean":
		case "null":
			return String(value);
		case "object":
			if (!value) {
				return "null"
			}
			gap += indent;
			partial = [];
			if (Object.prototype.toString.apply(value) === "[object Array]") {
				length = value.length;
				for (i = 0; i < length; i += 1) {
					partial[i] = str(i, value) || "null"
				}
				v = partial.length === 0 ? "[]" : gap ? "[\n" + gap
						+ partial.join(",\n" + gap) + "\n" + mind + "]" : "["
						+ partial.join(",") + "]";
				gap = mind;
				return v
			}
			if (rep && typeof rep === "object") {
				length = rep.length;
				for (i = 0; i < length; i += 1) {
					k = rep[i];
					if (typeof k === "string") {
						v = str(k, value);
						if (v) {
							partial.push(quote(k) + (gap ? ": " : ":") + v)
						}
					}
				}
			} else {
				for (k in value) {
					if (Object.hasOwnProperty.call(value, k)) {
						v = str(k, value);
						if (v) {
							partial.push(quote(k) + (gap ? ": " : ":") + v)
						}
					}
				}
			}
			v = partial.length === 0 ? "{}" : gap ? "{\n" + gap
					+ partial.join(",\n" + gap) + "\n" + mind + "}" : "{"
					+ partial.join(",") + "}";
			gap = mind;
			return v
		}
	}
	if (typeof JSON.stringify !== "function") {
		JSON.stringify = function(value, replacer, space) {
			var i;
			gap = "";
			indent = "";
			if (typeof space === "number") {
				for (i = 0; i < space; i += 1) {
					indent += " "
				}
			} else {
				if (typeof space === "string") {
					indent = space
				}
			}
			rep = replacer;
			if (replacer
					&& typeof replacer !== "function"
					&& (typeof replacer !== "object" || typeof replacer.length !== "number")) {
				throw new Error("JSON.stringify")
			}
			return str("", {
				"" : value
			})
		}
	}
	if (typeof JSON.parse !== "function") {
		JSON.parse = function(text, reviver) {
			var j;
			function walk(holder, key) {
				var k, v, value = holder[key];
				if (value && typeof value === "object") {
					for (k in value) {
						if (Object.hasOwnProperty.call(value, k)) {
							v = walk(value, k);
							if (v !== undefined) {
								value[k] = v
							} else {
								delete value[k]
							}
						}
					}
				}
				return reviver.call(holder, key, value)
			}
			text = String(text);
			cx.lastIndex = 0;
			if (cx.test(text)) {
				text = text.replace(cx, function(a) {
					return "\\u"
							+ ("0000" + a.charCodeAt(0).toString(16)).slice(-4)
				})
			}
			if (/^[\],:{}\s]*$/
					.test(text
							.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@")
							.replace(
									/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
									"]").replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) {
				j = eval("(" + text + ")");
				return typeof reviver === "function" ? walk({
					"" : j
				}, "") : j
			}
			throw new SyntaxError("JSON.parse")
		}
	}
}());
/*
 * ! Jigu Initialization more information:
 * http://play.nahfcorp.com/display/ftst/Jigu+Initialization
 */
(function() {
	if (!window.$) {
		window.$ = nahf.$
	}
	if (!window.$A) {
		window.$A = nahf.$A
	}
	if (!window.$E) {
		window.$E = nahf.$E
	}
	if (!window.$T) {
		window.$T = nahf.$T
	}
	if (!window.$C) {
		window.$C = nahf.$C
	}
	if (window.Sizzle) {
		window.$$ = nahf.$$ = window.Sizzle
	}
	nahf.extend(nahf, nahf.Event);
	nahf.extend(nahf, nahf.Browser);
	nahf.extend(nahf, nahf.Element);
	if (nahf.Event.GC != undefined) {
		window.JiguEventGC = nahf.Function.interval(nahf.Event.GC, 60000,
				nahf.Event)
	}
	nahf.Event.addEvent(window, "load", function() {
		nahf.documentLoaded = true
	});
	nahf.nativeExtend();
	if (!window.console) {
		window.console = {
			debug : function() {
			},
			log : function() {
			}
		}
	} else {
		if (!window.console.log) {
			window.console.debug = window.console.log = function() {
			}
		} else {
			if (!window.console.debug) {
				window.console.debug = function() {
					for ( var c = 0, d = arguments.length; c < d; c++) {
						window.console.log(arguments[c])
					}
				}
			}
		}
	}
	return true
})();
window.Jviewer = {};
(function(a) {
	a.config = {
		appName : "Jviewer",
		pageSize : 100,
		opacity : 1,
		callback : function(b) {
		},
		show : function() {
		},
		hide : function() {
		}
	};
	window.IS_DEBUG = nahf.urlParameter.log
})(Jviewer);
/*
 * ! extracted and modified from jQuery JavaScript Library v1.3.2
 * http://jquery.com/
 * 
 * Copyright (c) 2009 John Resig Dual licensed under the MIT and GPL licenses.
 * http://docs.jquery.com/License
 */
(function() {
	var f = false;
	function d() {
		if (f) {
			return
		}
		f = true;
		if (document.addEventListener) {
			document.addEventListener("DOMContentLoaded", function() {
				document.removeEventListener("DOMContentLoaded",
						arguments.callee, false);
				b()
			}, false)
		} else {
			if (document.attachEvent) {
				document.attachEvent("onreadystatechange", function() {
					if (document.readyState === "complete") {
						document.detachEvent("onreadystatechange",
								arguments.callee);
						b()
					}
				});
				if (document.documentElement.doScroll && window == window.top) {
					(function() {
						if (c) {
							return
						}
						try {
							document.documentElement.doScroll("left")
						} catch (g) {
							setTimeout(arguments.callee, 0);
							return
						}
						b()
					})()
				}
			}
		}
		nahf.Event.addEvent(window, "load", b)
	}
	var c = false;
	var e = [];
	function b() {
		if (!c) {
			c = true;
			if (e) {
				nahf.Array.each(e, function(g) {
					g.call(document, null)
				});
				e = null
			}
		}
	}
	function a(g) {
		d();
		if (c) {
			g.call(document, null)
		} else {
			e.push(g)
		}
		return this
	}
	window.domReady = a
})();
(function(b) {
	if (!b || !b.Event) {
		return false
	}
	var c = {
		mouse : {
			w3c : "MouseEvents",
			initEvt : function(d, i, f) {
				var h = b.extend({
					canBubble : true,
					cancelable : /^mouse(out|move)$/.test(f.type),
					view : window,
					detail : 1,
					screenX : 1,
					screenY : 1,
					clientX : 1,
					clientY : 1,
					ctrlKey : false,
					altKey : false,
					shiftKey : false,
					metaKey : false,
					button : 0,
					relatedTarget : i
				}, f);
				try {
					d.initMouseEvent(h.type, h.canBubble, h.cancelable, h.view,
							h.detail, h.screenX, h.screenY, h.clientX,
							h.clientY, h.ctrlKey, h.altKey, h.shiftKey,
							h.metaKey, h.button, h.relatedTarget)
				} catch (g) {
					throw new Error("can't initialize event")
				}
			}
		},
		keyboard : {
			w3c : b.Browser.op ? "Events" : "KeyboardEvent",
			initEvt : function(d, i, f) {
				var h = b.extend({
					bubbles : true,
					cancelable : true,
					view : i,
					ctrlKey : false,
					altKey : false,
					shiftKey : false,
					metaKey : false,
					keyCode : 0,
					charCode : 0
				}, f);
				try {
					(d.initKeyboardEvent || d.initKeyEvent || d.initEvent)
							.call(d, h.type, h.bubbles, h.cancelable, h.view,
									h.ctrlKey, h.altKey, h.shiftKey, h.metaKey,
									h.keyCode, h.charCode)
				} catch (g) {
					throw new Error("can't initialize event")
				}
			}
		},
		html : {
			w3c : "HTMLEvents",
			initEvt : function(d, h, f) {
				try {
					d.initEvent(f.type, f.canBubble, f.cancelable)
				} catch (g) {
					throw new Error("can't initialize event")
				}
			}
		}
	};
	var a = function(i, g, h) {
		var d, f;
		if (/^mouse(over|out|down|up|move)|(dbl)?click$/.test(g)) {
			f = c.mouse
		} else {
			if (/^key(up|down|press)$/.test(g)) {
				f = c.keyboard
			} else {
				f = c.html
			}
		}
		if (document.createEvent) {
			d = document.createEvent(f.w3c)
		} else {
			d = document.createEventObject();
			d.eventType = "on" + g
		}
		try {
			f.initEvt(d, i, b.extend({
				type : g
			}, h))
		} catch (j) {
			throw new Error("can't initialize event")
		}
		return d
	};
	(function(d) {
		if (document.dispatchEvent) {
			d.fireEvent = function(h, f, g) {
				var e;
				if (h === undefined) {
					return false
				}
				e = a(h, f, g);
				return e && h.dispatchEvent(e)
			}
		} else {
			if (document.fireEvent) {
				d.fireEvent = function(h, e, f) {
					var g = false;
					if (h === undefined) {
						return false
					}
					switch (e) {
					case "click":
						b.$(h).click();
						g = true;
						break;
					default:
						g = h.fireEvent("on" + e, f);
						g = e === "mouseover" && !g ? true : g
					}
					return g
				}
			}
		}
	})(b.Event);
	return true
})(nahf);
/*
 * ! klass: a classical JS OOP fa\u00e7ade https://github.com/ded/klass (c)
 * Dustin Diaz & Jacob Thornton License MIT
 */
!function(a, b) {
	if (typeof define == "function") {
		define(b)
	} else {
		if (typeof module != "undefined") {
			module.exports = b()
		} else {
			this[a] = b()
		}
	}
}
		(
				"klass",
				function() {
					var c = this, d = c.klass, h = "function", k = /xyz/
							.test(function() {
								xyz
							}) ? /\bsupr\b/ : /.*/, l = function() {
					}, e = "prototype", g = function(f) {
						return typeof f === h
					};
					function i(f) {
						return j.call(g(f) ? f : l, f, 1)
					}
					function b(m, n, f) {
						return function() {
							var p = this.supr;
							this.supr = f[e][m];
							var o = n.apply(this, arguments);
							this.supr = p;
							return o
						}
					}
					function a(n, p, f) {
						for ( var m in p) {
							if (p.hasOwnProperty(m)) {
								n[m] = g(p[m]) && g(f[e][m]) && k.test(p[m]) ? b(
										m, p[m], f)
										: p[m]
							}
						}
					}
					function j(n, q) {
						function u() {
						}
						u[e] = this[e];
						var r = this, t = new u(), p = g(n), f = p ? n : this, m = p ? {}
								: n, s = function() {
							if (this.initialize) {
								this.initialize.apply(this, arguments)
							} else {
								q || p && r.apply(this, arguments);
								f.apply(this, arguments)
							}
						};
						s.methods = function(v) {
							a(t, v, r);
							s[e] = t;
							return this
						};
						s.methods.call(s, m).prototype.constructor = s;
						s.extend = arguments.callee;
						s[e].implement = s.statics = function(w, v) {
							w = typeof w == "string" ? (function() {
								var o = {};
								o[w] = v;
								return o
							}()) : w;
							a(this, w, r);
							return this
						};
						return s
					}
					i.noConflict = function() {
						c.klass = d;
						return this
					};
					c.klass = i;
					return i
				});
var Debug = function(b, a) {
	this.prefix = b;
	this.type = a || "log"
};
Debug.prototype = {
	print : function() {
		if (!IS_DEBUG) {
			return
		}
		var a = [ "[" + this.prefix + "]" ].concat($A(arguments));
		var b = console[this.type];
		if (!!console && !!b) {
			if (navigator.userAgent.indexOf("iPhone OS") > -1) {
				a[0] = a.join(" ")
			}
			if (typeof (b) == "function") {
				b.apply(console, a)
			} else {
				b(a.join(", "))
			}
		}
	}
};
nahf.getJSON = (function() {
	var b = "jiguJsonp";
	
	if (typeof window[b + "Count"] == "undefined") {
		window[b + "Count"] = 0
	}
	
	var c = /\=\?(&|$)/, a = document.getElementsByTagName("head")[0]
			|| document.documentElement;
	
	return function(e, f) {
		
		var d = document.createElement("script");
		
		jsonp = b + String(window[b + "Count"]++);
		
		if (c.test(e)) {
			e = e.replace(c, "=" + jsonp + "$1")
		}
		window[jsonp] = function(h) {
			if (typeof f == "function") {
				f(h)
			} else {
				window[jsonp] = undefined;
				try {
					delete window[jsonp]
				} catch (g) {
				}
			}
			if (a) {
				a.removeChild(d)
			}
		};
		d.src = e;
		a.insertBefore(d, a.firstChild)
	}
})();
(function() {
	window.__pageTracker = {};
	if (typeof __Tiara !== "undefined"
			&& typeof __Tiara.__getTracker !== "undefined") {
		__pageTracker = __Tiara.__getTracker()
	} else {
		__pageTracker.__setTitle = function() {
		};
		__pageTracker.__setReferer = function() {
		};
		__pageTracker.__trackPageview = function() {
		}
	}
	window.callTiara = function(b, g, c) {
		try {
			var f = b;
			var a = g;
			if (typeof __pageTracker !== "undefined") {
				__pageTracker.__setTitle(a);
				__pageTracker.__setReferer(document.referrer);
				if (c) {
					__pageTracker.__addParam("svcdomain", c)
				}
				window.setTimeout(function() {
					try {
						window.__pageTracker.__trackPageview(f)
					} catch (h) {
					}
				}, 1)
			}
		} catch (d) {
		}
	}
})();
(function(a) {
	Jviewer.Util = {
		registerNamespace : function() {
			var g = arguments, e = null, f, d, h, c, k, b, l;
			for (f = 0, b = g.length; f < b; f++) {
				h = g[f];
				c = h.split(".");
				k = c[0];
				if (typeof a[k] === "undefined") {
					a[k] = {}
				}
				e = a[k];
				for (d = 1, l = c.length; d < l; ++d) {
					e[c[d]] = e[c[d]] || {};
					e = e[c[d]]
				}
			}
		},
		coalesce : function() {
			var c, b;
			for (c = 0, b = arguments.length; c < b; c++) {
				if (!this.isNothing(arguments[c])) {
					return arguments[c]
				}
			}
			return null
		},
		extend : function(b, c, d) {
			var e;
			if (this.isNothing(d)) {
				d = true
			}
			if (b && c && this.isObject(c)) {
				for (e in c) {
					if (this.objectHasProperty(c, e)) {
						if (d) {
							b[e] = c[e]
						} else {
							if (typeof b[e] === "undefined") {
								b[e] = c[e]
							}
						}
					}
				}
			}
		},
		clone : function(c) {
			var b = {};
			this.extend(b, c);
			return b
		},
		isObject : function(b) {
			return b instanceof Object
		},
		isFunction : function(b) {
			return ({}).toString.call(b) === "[object Function]"
		},
		isArray : function(b) {
			return b instanceof Array
		},
		isLikeArray : function(b) {
			return typeof b.length === "number"
		},
		isNumber : function(b) {
			return typeof b === "number"
		},
		isString : function(b) {
			return typeof b === "string"
		},
		isNothing : function(b) {
			if (typeof b === "undefined" || b === null) {
				return true
			}
			return false
		},
		swapArrayElements : function(b, e, d) {
			var c = b[e];
			b[e] = b[d];
			b[d] = c
		},
		trim : function(b) {
			return b.replace(/^\s\s*/, "").replace(/\s\s*$/, "")
		},
		toCamelCase : function(b) {
			return b.replace(/(\-[a-z])/g, function(c) {
				return c.toUpperCase().replace("-", "")
			})
		},
		toDashedCase : function(b) {
			return b.replace(/([A-Z])/g, function(c) {
				return "-" + c.toLowerCase()
			})
		},
		arrayIndexOf : function(f, h, g) {
			var e, d, c, b;
			c = -1;
			for (e = 0, d = h.length; e < d; e++) {
				b = h[e];
				if (!this.isNothing(g)) {
					if (this.objectHasProperty(b, g)) {
						if (b[g] === f) {
							c = e;
							break
						}
					}
				} else {
					if (b === f) {
						c = e;
						break
					}
				}
			}
			return c
		},
		objectHasProperty : function(c, b) {
			if (c.hasOwnProperty) {
				return c.hasOwnProperty(b)
			} else {
				return ("undefined" !== typeof c[b])
			}
		},
		isAppMode : function() {
			var b = nahf.getCookie("nahfGlueApp") || "";
			if (b.indexOf("DaumApps") > -1) {
				return true
			} else {
				return false
			}
		},
		randomString : function(d) {
			var c = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz"
					.split("");
			if (!d) {
				d = Math.floor(Math.random() * c.length)
			}
			var e = "";
			for ( var b = 0; b < d; b++) {
				e += c[Math.floor(Math.random() * c.length)]
			}
			return e
		}
	}
}(window));
(function(a, b) {
	b.Browser = {
		ua : null,
		version : null,
		safari : null,
		webkit : null,
		opera : null,
		msie : null,
		chrome : null,
		mozilla : null,
		android : null,
		blackberry : null,
		iPad : null,
		iPhone : null,
		iPod : null,
		iOS : null,
		is3dSupported : null,
		isCSSTransformSupported : null,
		isTouchSupported : null,
		isGestureSupported : null,
		_detect : function() {
			this.ua = a.navigator.userAgent;
			this.version = (this.ua.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || []);
			this.safari = (/Safari/gi).test(a.navigator.appVersion);
			this.webkit = /webkit/i.test(this.ua);
			this.opera = /opera/i.test(this.ua);
			this.msie = /msie/i.test(this.ua) && !this.opera;
			this.chrome = /Chrome/i.test(this.ua);
			this.firefox = /Firefo/i.test(this.ua);
			this.mozilla = /mozilla/i.test(this.ua)
					&& !/(compatible|webkit)/.test(this.ua);
			this.android = /android/i.test(this.ua);
			this.blackberry = /blackberry/i.test(this.ua);
			this.iOS = (/iphone|ipod|ipad/gi).test(this.ua);
			this.iPad = (/ipad/gi).test(this.ua);
			this.iPhone = (/iphone/gi).test(this.ua);
			this.iPod = (/ipod/gi).test(this.ua);
			this.uiwebview = (this.iPhone || this.iPad || this.iPod)
					&& this.webkit && this.ua_contains("!safari");
			var c = document.createElement("div");
			this.is3dSupported = !b.isNothing(c.style.WebkitPerspective);
			this.isCSSTransformSupported = (!b
					.isNothing(c.style.WebkitTransform)
					|| !b.isNothing(c.style.MozTransform) || !b
					.isNothing(c.style.transformProperty));
			this.isTouchSupported = this.isEventSupported("touchstart");
			this.isGestureSupported = this.isEventSupported("gesturestart");
			if (this.android && /DaumApps/.test(navigator.userAgent)) {
				this.is3dSupported = false
			}
		},
		ua_contains : function(e) {
			var c = (typeof e == "string") ? new Array(e) : e, d = 0;
			c.each(function(f) {
				d += (f.substr(0, 1) == "!") ? nahf.Browser.ua.indexOf(f
						.substr(1)) === -1 : nahf.Browser.ua.indexOf(f) > -1
			});
			return c.length === d
		},
		_eventTagNames : {
			select : "input",
			change : "input",
			submit : "form",
			reset : "form",
			error : "img",
			load : "img",
			abort : "img"
		},
		isEventSupported : function(c) {
			var e = document.createElement(this._eventTagNames[c] || "div"), d;
			c = "on" + c;
			d = b.objectHasProperty(e, c);
			if (!d) {
				e.setAttribute(c, "return;");
				d = typeof e[c] === "function"
			}
			e = null;
			return d
		}
	};
	b.Browser._detect()
}(window, window.Jviewer.Util));
(function(a, b) {
	b
			.extend(
					b,
					{
						Events : {
							add : function(e, d, c) {
								this._checkHandlersProperty(e);
								if (typeof e.__eventHandlers[d] === "undefined") {
									e.__eventHandlers[d] = []
								}
								e.__eventHandlers[d].push(c);
								if (this._isBrowserObject(e)) {
									nahf.addEvent(e, d, c)
								}
							},
							remove : function(h, g, f) {
								this._checkHandlersProperty(h);
								if (g === "mousewheel") {
									g = this._normaliseMouseWheelType()
								}
								if (h.__eventHandlers[g] instanceof Array) {
									var e, d, c = h.__eventHandlers[g];
									if (b.isNothing(f)) {
										if (this._isBrowserObject(h)) {
											for (e = 0, d = c.length; e < d; e++) {
												h.removeEventListener(g, c[e],
														false)
											}
										}
										h.__eventHandlers[g] = [];
										return
									}
									for (e = 0, d = c.length; e < d; e++) {
										if (c[e] === f) {
											c.splice(e, 1);
											break
										}
									}
									if (this._isBrowserObject(h)) {
										nahf.removeEvent(h, g, f);
										return
									}
								}
							},
							fire : function(g, l) {
								var h, f, d, m, e, k = Array.prototype.slice
										.call(arguments).splice(2), c;
								if (l === "mousewheel") {
									l = this._normaliseMouseWheelType()
								}
								if (this._isBrowserObject(g)) {
									if (typeof l !== "string") {
										throw "type must be a string for DOM elements"
									}
									c = this._NATIVE_EVENTS[l];
									d = document.createEvent(c ? "HTMLEvents"
											: "UIEvents");
									d[c ? "initEvent" : "initUIEvent"](l, true,
											true, a, 1);
									if (k.length < 1) {
										g.dispatchEvent(d);
										return
									}
								}
								this._checkHandlersProperty(g);
								if (typeof l === "string") {
									d = {
										type : l
									}
								} else {
									d = l
								}
								if (!d.target) {
									d.target = g
								}
								if (!d.type) {
									throw new Error(
											"Event object missing 'type' property.")
								}
								if (g.__eventHandlers[d.type] instanceof Array) {
									m = g.__eventHandlers[d.type];
									k.unshift(d);
									for (h = 0, f = m.length; h < f; h++) {
										e = m[h];
										if (!b.isNothing(e)) {
											e.apply(g, k)
										}
									}
								}
							},
							getMousePosition : function(d) {
								var c = {
									x : 0,
									y : 0
								};
								if (d.pageX) {
									c.x = d.pageX
								} else {
									if (d.clientX) {
										c.x = d.clientX
												+ (document.documentElement.scrollLeft || document.body.scrollLeft)
									}
								}
								if (d.pageY) {
									c.y = d.pageY
								} else {
									if (d.clientY) {
										c.y = d.clientY
												+ (document.documentElement.scrollTop || document.body.scrollTop)
									}
								}
								return c
							},
							getTouchEvent : function(c) {
								return c
							},
							getWheelDelta : function(c) {
								var d = 0;
								if (!b.isNothing(c.wheelDelta)) {
									d = c.wheelDelta / 120
								} else {
									if (!b.isNothing(c.detail)) {
										d = -c.detail / 3
									}
								}
								return d
							},
							domReady : function(c) {
								a.domReady(c)
							},
							_checkHandlersProperty : function(c) {
								if (b.isNothing(c.__eventHandlers)) {
									b.extend(c, {
										__eventHandlers : {}
									})
								}
							},
							_isBrowserObject : function(c) {
								if (c === a || c === a.document) {
									return true
								}
								return this._isElement(c) || this._isNode(c)
							},
							_isElement : function(c) {
								return (typeof a.HTMLElement === "object" ? c instanceof a.HTMLElement
										: typeof c === "object"
												&& c.nodeType === 1
												&& typeof c.nodeName === "string")
							},
							_isNode : function(c) {
								return (typeof a.Node === "object" ? c instanceof a.Node
										: typeof c === "object"
												&& typeof c.nodeType === "number"
												&& typeof c.nodeName === "string")
							},
							_normaliseMouseWheelType : function() {
								if (b.Browser.isEventSupported("mousewheel")) {
									return "mousewheel"
								}
								return "DOMMouseScroll"
							},
							_NATIVE_EVENTS : {
								click : 1,
								dblclick : 1,
								mouseup : 1,
								mousedown : 1,
								contextmenu : 1,
								mousewheel : 1,
								DOMMouseScroll : 1,
								mouseover : 1,
								mouseout : 1,
								mousemove : 1,
								selectstart : 1,
								selectend : 1,
								keydown : 1,
								keypress : 1,
								keyup : 1,
								orientationchange : 1,
								touchstart : 1,
								touchmove : 1,
								touchend : 1,
								touchcancel : 1,
								gesturestart : 1,
								gesturechange : 1,
								gestureend : 1,
								focus : 1,
								blur : 1,
								change : 1,
								reset : 1,
								select : 1,
								submit : 1,
								load : 1,
								unload : 1,
								beforeunload : 1,
								resize : 1,
								move : 1,
								DOMContentLoaded : 1,
								readystatechange : 1,
								error : 1,
								abort : 1,
								scroll : 1
							}
						}
					})
}(window, window.Jviewer.Util));
(function(a, b) {
	b
			.extend(
					b,
					{
						DOM : {
							setData : function(d, c, e) {
								b.DOM.setAttribute(d, "data-" + c, e)
							},
							getData : function(e, d, c) {
								return b.DOM.getAttribute(e, "data-" + d, c)
							},
							removeData : function(d, c) {
								b.DOM.removeAttribute(d, "data-" + c)
							},
							isChildOf : function(c, d) {
								if (d === c) {
									return false
								}
								while (c && c !== d) {
									c = c.parentNode
								}
								return c === d
							},
							find : function(g, h) {
								if (b.isNothing(h)) {
									h = a.document
								}
								var f = $$(g, h), c = [], e, d;
								for (e = 0, d = f.length; e < d; e++) {
									c.push(f[e])
								}
								return c
							},
							createElement : function(e, d, f) {
								var c = nahf.createElement(e, d);
								c.innerHTML = f || "";
								return c
							},
							appendChild : function(c, d) {
								d.appendChild(c)
							},
							insertBefore : function(e, c, d) {
								d.insertBefore(e, c)
							},
							appendText : function(d, c) {
								b.DOM
										.appendChild(
												document.createTextNode(d), c)
							},
							appendToBody : function(c) {
								this.appendChild(c, document.body)
							},
							removeChild : function(c, d) {
								d.removeChild(c)
							},
							removeChildren : function(c) {
								if (c.hasChildNodes()) {
									while (c.childNodes.length >= 1) {
										c
												.removeChild(c.childNodes[c.childNodes.length - 1])
									}
								}
							},
							hasAttribute : function(d, c) {
								return !b.isNothing(d.getAttribute(c))
							},
							getAttribute : function(f, e, d) {
								var c = f.getAttribute(e);
								if (b.isNothing(c) && !b.isNothing(d)) {
									c = d
								}
								return c
							},
							setAttribute : function(d, c, e) {
								if (c == "style") {
									nahf.setStyle(d, e)
								} else {
									d.setAttribute(c, e)
								}
							},
							removeAttribute : function(d, c) {
								if (this.hasAttribute(d, c)) {
									d.removeAttribute(c)
								}
							},
							addClass : function(d, c) {
								nahf.addClassName(d, c)
							},
							removeClass : function(d, c) {
								nahf.removeClassName(d, c)
							},
							hasClass : function(d, c) {
								nahf.hasClassName(d, c)
							},
							setStyle : function(d, c, f) {
								var i, h;
								if (b.isObject(c)) {
									for (i in c) {
										if (b.objectHasProperty(c, i)) {
											if (i === "width") {
												b.DOM.width(d, c[i])
											} else {
												if (i === "height") {
													b.DOM.height(d, c[i])
												} else {
													if (i == "opacity") {
														nahf
																.setOpacity(d,
																		c[i])
													} else {
														try {
															nahf.setStyle(d, i,
																	c[i]);
															d.style[i] = c[i]
														} catch (g) {
															d.style[i] = c[i]
														}
													}
												}
											}
										}
									}
								} else {
									d.style[c] = f
								}
							},
							getStyle : function(d, c) {
								return nahf.getStyle(d, c)
							},
							hide : function(c) {
								nahf.hide(c)
							},
							show : function(c) {
								nahf.show(c)
							},
							width : function(c, d) {
								if (!b.isNothing(d)) {
									nahf.setWidth(c, d)
								}
								return nahf.getStyle(c, "width").toInt()
							},
							outerWidth : function(d) {
								var c = b.DOM.width(d);
								c += parseInt(
										b.DOM.getStyle(d, "padding-left"), 10)
										+ parseInt(b.DOM.getStyle(d,
												"padding-right"), 10);
								c += parseInt(b.DOM.getStyle(d, "margin-left"),
										10)
										+ parseInt(b.DOM.getStyle(d,
												"margin-right"), 10);
								c += parseInt(b.DOM.getStyle(d,
										"border-left-width"), 10)
										+ parseInt(b.DOM.getStyle(d,
												"border-right-width"), 10);
								return c
							},
							height : function(d, e) {
								if (!b.isNothing(e)) {
									nahf.setHeight(d, e)
								}
								var c = nahf.getStyle(d, "height").toInt();
								if (isNaN(c)) {
									return 0
								}
								return c
							},
							outerHeight : function(d) {
								var c = b.DOM.height(d);
								c += parseInt(b.DOM.getStyle(d, "padding-top"),
										10)
										+ parseInt(b.DOM.getStyle(d,
												"padding-bottom"), 10);
								c += parseInt(b.DOM.getStyle(d, "margin-top"),
										10)
										+ parseInt(b.DOM.getStyle(d,
												"margin-bottom"), 10);
								return c
							},
							documentWidth : function() {
								return b.DOM.width(document.documentElement)
							},
							documentHeight : function() {
								return b.DOM.height(document.documentElement)
							},
							documentOuterWidth : function() {
								return b.DOM.width(document.documentElement)
							},
							documentOuterHeight : function() {
								return b.DOM
										.outerHeight(document.documentElement)
							},
							bodyWidth : function() {
								return b.DOM.width(document.body)
							},
							bodyHeight : function() {
								return b.DOM.height(document.body)
							},
							bodyOuterWidth : function() {
								return b.DOM.outerWidth(document.body)
							},
							bodyOuterHeight : function() {
								return b.DOM.outerHeight(document.body)
							},
							windowWidth : function() {
								var c = nahf.Browser.getWindowSize();
								return c.width
							},
							windowHeight : function() {
								var c = nahf.Browser.getWindowSize();
								return c.height
							},
							windowScrollLeft : function() {
								var c = nahf.Browser.getScrollOffsets();
								return c.left
							},
							windowScrollTop : function() {
								var c = nahf.Browser.getScrollOffsets();
								return c.top
							}
						}
					})
}(window, window.Jviewer.Util));
(function(a, b) {
	b
			.extend(
					b,
					{
						Animation : {
							_applyTransitionDelay : 50,
							_transitionEndLabel : (a.document.documentElement.style.webkitTransition !== undefined) ? "webkitTransitionEnd"
									: "transitionend",
							_transitionEndHandler : null,
							_transitionPrefix : (a.document.documentElement.style.webkitTransition !== undefined) ? "webkitTransition"
									: (a.document.documentElement.style.MozTransition !== undefined) ? "MozTransition"
											: "transition",
							_transformLabel : (a.document.documentElement.style.webkitTransform !== undefined) ? "webkitTransform"
									: (a.document.documentElement.style.MozTransition !== undefined) ? "MozTransform"
											: "transform",
							_getTransitionEndHandler : function() {
								if (b.isNothing(this._transitionEndHandler)) {
									this._transitionEndHandler = this._onTransitionEnd
											.bind(this)
								}
								return this._transitionEndHandler
							},
							stop : function(d) {
								if (b.Browser.isCSSTransformSupported) {
									var e = d.style[this._transitionPrefix
											+ "Property"], f = (e !== "") ? "ccl"
											+ e + "callback"
											: "cclallcallback", c = {};
									b.Events
											.remove(
													d,
													this._transitionEndLabel,
													this
															._getTransitionEndHandler());
									if (b.isNothing(d.callbackLabel)) {
										delete d.callbackLabel
									}
									c[this._transitionPrefix + "Property"] = "";
									c[this._transitionPrefix + "Duration"] = "";
									c[this._transitionPrefix + "TimingFunction"] = "";
									c[this._transitionPrefix + "Delay"] = "";
									c[this._transformLabel] = "";
									b.DOM.setStyle(d, c)
								} else {
									nahf.Fx.stop(d)
								}
							},
							fadeIn : function(e, g, h, f, d) {
								d = b.coalesce(d, 1);
								if (d <= 0) {
									d = 1
								}
								if (g <= 0) {
									b.DOM.setStyle(e, "opacity", d);
									if (!b.isNothing(h)) {
										h(e);
										return
									}
								}
								var c = b.DOM.getStyle(e, "opacity");
								if (c >= 1) {
									b.DOM.setStyle(e, "opacity", 0)
								}
								if (b.Browser.isCSSTransformSupported) {
									this._applyTransition(e, "opacity", d, g,
											h, f)
								} else {
									nahf.Fx.animate(e, "opacity:" + d, {
										callback : h
									})
								}
							},
							fadeTo : function(d, c, f, g, e) {
								this.fadeIn(d, f, g, e, c)
							},
							fadeOut : function(c, e, f, d) {
								if (e <= 0) {
									b.DOM.setStyle(c, "opacity", 0);
									if (!b.isNothing(f)) {
										f(c);
										return
									}
								}
								if (b.Browser.isCSSTransformSupported) {
									this._applyTransition(c, "opacity", 0, e,
											f, d)
								} else {
									nahf.Fx.animate(c, "opacity:0", {
										callback : f
									})
								}
							},
							slideBy : function(e, c, i, g, h, f) {
								var d = {};
								c = b.coalesce(c, 0);
								i = b.coalesce(i, 0);
								f = b.coalesce(f, "ease-out");
								d[this._transitionPrefix + "Property"] = "all";
								d[this._transitionPrefix + "Delay"] = "0";
								if (g === 0) {
									d[this._transitionPrefix + "Duration"] = "";
									d[this._transitionPrefix + "TimingFunction"] = ""
								} else {
									d[this._transitionPrefix + "Duration"] = g
											+ "ms";
									d[this._transitionPrefix + "TimingFunction"] = b
											.coalesce(f, "ease-out");
									b.Events.add(e, this._transitionEndLabel,
											this._getTransitionEndHandler())
								}
								d[this._transformLabel] = (b.Browser.is3dSupported) ? "translate3d("
										+ c + "px, " + i + "px, 0px)"
										: "translate(" + c + "px, " + i + "px)";
								if (!b.isNothing(h)) {
									e.cclallcallback = h
								}
								b.DOM.setStyle(e, d);
								if (g === 0) {
									a.setTimeout(function() {
										this._leaveTransforms(e)
									}.bind(this), this._applyTransitionDelay)
								}
							},
							resetTranslate : function(d) {
								var c = {};
								c[this._transformLabel] = c[this._transformLabel] = (b.Browser.is3dSupported) ? "translate3d(0px, 0px, 0px)"
										: "translate(0px, 0px)";
								b.DOM.setStyle(d, c)
							},
							_applyTransition : function(d, g, h, f, i, e) {
								var c = {};
								e = b.coalesce(e, "ease-in");
								c[this._transitionPrefix + "Property"] = g;
								c[this._transitionPrefix + "Duration"] = f
										+ "ms";
								c[this._transitionPrefix + "TimingFunction"] = e;
								c[this._transitionPrefix + "Delay"] = "0";
								b.Events.add(d, this._transitionEndLabel, this
										._getTransitionEndHandler());
								b.DOM.setStyle(d, c);
								if (!b.isNothing(i)) {
									d["ccl" + g + "callback"] = i
								}
								a.setTimeout(function() {
									b.DOM.setStyle(d, g, h)
								}, this._applyTransitionDelay)
							},
							_onTransitionEnd : function(c) {
								b.Events.remove(c.currentTarget,
										this._transitionEndLabel, this
												._getTransitionEndHandler());
								this._leaveTransforms(c.currentTarget)
							},
							_leaveTransforms : function(f) {
								var l = f.style[this._transitionPrefix
										+ "Property"], k = (l !== "") ? "ccl"
										+ l + "callback" : "cclallcallback", n, g = b
										.coalesce(f.style.webkitTransform,
												f.style.MozTransform,
												f.style.transform), i, m, j = a
										.parseInt(b.DOM.getStyle(f, "left"), 0), h = a
										.parseInt(b.DOM.getStyle(f, "top"), 0), e, d, c = {};
								if (g !== "") {
									if (b.Browser.is3dSupported) {
										i = g.match(/translate3d\((.*?)\)/)
									} else {
										i = g.match(/translate\((.*?)\)/)
									}
									if (!b.isNothing(i)) {
										m = i[1].split(", ");
										e = a.parseInt(m[0], 0);
										d = a.parseInt(m[1], 0)
									}
								}
								c[this._transitionPrefix + "Property"] = "";
								c[this._transitionPrefix + "Duration"] = "";
								c[this._transitionPrefix + "TimingFunction"] = "";
								c[this._transitionPrefix + "Delay"] = "";
								b.DOM.setStyle(f, c);
								a.setTimeout(function() {
									if (!b.isNothing(m)) {
										c = {};
										c[this._transformLabel] = "";
										c.left = (j + e) + "px";
										c.top = (h + d) + "px";
										b.DOM.setStyle(f, c)
									}
									if (!b.isNothing(f[k])) {
										n = f[k];
										delete f[k];
										n(f)
									}
								}.bind(this), this._applyTransitionDelay)
							}
						}
					})
}(window, window.Jviewer.Util));
(function(b, a, c) {
	c.registerNamespace("Jviewer.Util.TouchElement");
	c.TouchElement.EventTypes = {
		onTouch : "CodeUtilTouchElementOnTouch"
	};
	c.TouchElement.ActionTypes = {
		touchStart : "touchStart",
		touchMove : "touchMove",
		touchEnd : "touchEnd",
		touchMoveEnd : "touchMoveEnd",
		tap : "tap",
		doubleTap : "doubleTap",
		swipeLeft : "swipeLeft",
		swipeRight : "swipeRight",
		swipeUp : "swipeUp",
		swipeDown : "swipeDown",
		gestureStart : "gestureStart",
		gestureChange : "gestureChange",
		gestureEnd : "gestureEnd"
	}
}(window, window.klass, window.Jviewer.Util));
(function(b, a, c) {
	c.registerNamespace("Util.TouchElement");
	c.TouchElement.TouchElementClass = a({
		el : null,
		captureSettings : null,
		touchStartPoint : null,
		touchEndPoint : null,
		touchStartTime : null,
		doubleTapTimeout : null,
		touchStartHandler : null,
		touchMoveHandler : null,
		touchEndHandler : null,
		mouseDownHandler : null,
		mouseMoveHandler : null,
		mouseUpHandler : null,
		mouseOutHandler : null,
		gestureStartHandler : null,
		gestureChangeHandler : null,
		gestureEndHandler : null,
		swipeThreshold : null,
		swipeTimeThreshold : null,
		doubleTapSpeed : null,
		dispose : function() {
			var d;
			this.removeEventHandlers();
			for (d in this) {
				if (c.objectHasProperty(this, d)) {
					this[d] = null
				}
			}
		},
		initialize : function(d, e) {
			this.el = d;
			this.captureSettings = {
				swipe : false,
				move : false,
				gesture : false,
				doubleTap : false,
				preventDefaultTouchEvents : true
			};
			c.extend(this.captureSettings, e);
			this.swipeThreshold = 50;
			this.swipeTimeThreshold = 250;
			this.doubleTapSpeed = 250;
			this.touchStartPoint = {
				x : 0,
				y : 0
			};
			this.touchEndPoint = {
				x : 0,
				y : 0
			}
		},
		addEventHandlers : function() {
			if (c.isNothing(this.touchStartHandler)) {
				this.touchStartHandler = this.onTouchStart.bind(this);
				this.touchMoveHandler = this.onTouchMove.bind(this);
				this.touchEndHandler = this.onTouchEnd.bind(this);
				this.mouseDownHandler = this.onMouseDown.bind(this);
				this.mouseMoveHandler = this.onMouseMove.bind(this);
				this.mouseUpHandler = this.onMouseUp.bind(this);
				this.mouseOutHandler = this.onMouseOut.bind(this);
				this.gestureStartHandler = this.onGestureStart.bind(this);
				this.gestureChangeHandler = this.onGestureChange.bind(this);
				this.gestureEndHandler = this.onGestureEnd.bind(this)
			}
			c.Events.add(this.el, "touchstart", this.touchStartHandler);
			if (this.captureSettings.move) {
				c.Events.add(this.el, "touchmove", this.touchMoveHandler)
			}
			c.Events.add(this.el, "touchend", this.touchEndHandler);
			c.Events.add(this.el, "mousedown", this.mouseDownHandler);
			if (c.Browser.isGestureSupported && this.captureSettings.gesture) {
				c.Events.add(this.el, "gesturestart", this.gestureStartHandler);
				c.Events.add(this.el, "gesturechange",
						this.gestureChangeHandler);
				c.Events.add(this.el, "gestureend", this.gestureEndHandler)
			}
		},
		removeEventHandlers : function() {
			c.Events.remove(this.el, "touchstart", this.touchStartHandler);
			if (this.captureSettings.move) {
				c.Events.remove(this.el, "touchmove", this.touchMoveHandler)
			}
			c.Events.remove(this.el, "touchend", this.touchEndHandler);
			c.Events.remove(this.el, "mousedown", this.mouseDownHandler);
			if (c.Browser.isGestureSupported && this.captureSettings.gesture) {
				c.Events.remove(this.el, "gesturestart",
						this.gestureStartHandler);
				c.Events.remove(this.el, "gesturechange",
						this.gestureChangeHandler);
				c.Events.remove(this.el, "gestureend", this.gestureEndHandler)
			}
		},
		getTouchPoint : function(d) {
			return {
				x : d[0].pageX,
				y : d[0].pageY
			}
		},
		fireTouchEvent : function() {
			var i, e = 0, d = 0, j = 0, g, f, h;
			e = this.touchEndPoint.x - this.touchStartPoint.x;
			d = this.touchEndPoint.y - this.touchStartPoint.y;
			j = Math.sqrt((e * e) + (d * d));
			if (this.captureSettings.swipe) {
				f = new Date();
				h = f - this.touchStartTime;
				if (h <= this.swipeTimeThreshold) {
					if (b.Math.abs(e) >= this.swipeThreshold) {
						c.Events
								.fire(
										this,
										{
											type : c.TouchElement.EventTypes.onTouch,
											target : this,
											point : this.touchEndPoint,
											action : (e < 0) ? c.TouchElement.ActionTypes.swipeLeft
													: c.TouchElement.ActionTypes.swipeRight
										});
						return
					}
					if (b.Math.abs(d) >= this.swipeThreshold) {
						c.Events
								.fire(
										this,
										{
											type : c.TouchElement.EventTypes.onTouch,
											target : this,
											point : this.touchEndPoint,
											action : (d < 0) ? c.TouchElement.ActionTypes.swipeUp
													: c.TouchElement.ActionTypes.swipeDown
										});
						return
					}
				}
			}
			if (j > 1) {
				c.Events.fire(this, {
					type : c.TouchElement.EventTypes.onTouch,
					target : this,
					action : c.TouchElement.ActionTypes.touchMoveEnd,
					point : this.touchEndPoint
				});
				return
			}
			if (!this.captureSettings.doubleTap) {
				c.Events.fire(this, {
					type : c.TouchElement.EventTypes.onTouch,
					target : this,
					point : this.touchEndPoint,
					action : c.TouchElement.ActionTypes.tap
				});
				return
			}
			if (c.isNothing(this.doubleTapTimeout)) {
				this.doubleTapTimeout = b.setTimeout(function() {
					this.doubleTapTimeout = null;
					c.Events.fire(this, {
						type : c.TouchElement.EventTypes.onTouch,
						target : this,
						point : this.touchEndPoint,
						action : c.TouchElement.ActionTypes.tap
					})
				}.bind(this), this.doubleTapSpeed);
				return
			} else {
				b.clearTimeout(this.doubleTapTimeout);
				this.doubleTapTimeout = null;
				c.Events.fire(this, {
					type : c.TouchElement.EventTypes.onTouch,
					target : this,
					point : this.touchEndPoint,
					action : c.TouchElement.ActionTypes.doubleTap
				})
			}
		},
		onTouchStart : function(g) {
			if (this.captureSettings.preventDefaultTouchEvents) {
				nahf.preventDefault(g)
			}
			c.Events.remove(this.el, "mousedown", this.mouseDownHandler);
			var d = c.Events.getTouchEvent(g), f = d.touches;
			if (f.length > 1 && this.captureSettings.gesture) {
				this.isGesture = true;
				return
			}
			this.touchStartTime = new Date();
			this.isGesture = false;
			this.touchStartPoint = this.getTouchPoint(f);
			c.Events.fire(this, {
				type : c.TouchElement.EventTypes.onTouch,
				target : this,
				action : c.TouchElement.ActionTypes.touchStart,
				point : this.touchStartPoint
			})
		},
		onTouchMove : function(g) {
			if (this.captureSettings.preventDefaultTouchEvents) {
				nahf.preventDefault(g)
			}
			if (this.isGesture && this.captureSettings.gesture) {
				return
			}
			var d = c.Events.getTouchEvent(g), f = d.touches;
			c.Events.fire(this, {
				type : c.TouchElement.EventTypes.onTouch,
				target : this,
				action : c.TouchElement.ActionTypes.touchMove,
				point : this.getTouchPoint(f)
			})
		},
		onTouchEnd : function(g) {
			if (this.isGesture && this.captureSettings.gesture) {
				return
			}
			if (this.captureSettings.preventDefaultTouchEvents) {
				nahf.preventDefault(g)
			}
			var d = c.Events.getTouchEvent(g), f = (!c
					.isNothing(d.changedTouches)) ? d.changedTouches
					: d.touches;
			this.touchEndPoint = this.getTouchPoint(f);
			c.Events.fire(this, {
				type : c.TouchElement.EventTypes.onTouch,
				target : this,
				action : c.TouchElement.ActionTypes.touchEnd,
				point : this.touchEndPoint
			});
			this.fireTouchEvent()
		},
		onMouseDown : function(d) {
			nahf.preventDefault(d);
			c.Events.remove(this.el, "touchstart", this.mouseDownHandler);
			c.Events.remove(this.el, "touchmove", this.touchMoveHandler);
			c.Events.remove(this.el, "touchend", this.touchEndHandler);
			if (this.captureSettings.move) {
				c.Events.add(this.el, "mousemove", this.mouseMoveHandler)
			}
			c.Events.add(this.el, "mouseup", this.mouseUpHandler);
			c.Events.add(this.el, "mouseout", this.mouseOutHandler);
			this.touchStartTime = new Date();
			this.isGesture = false;
			this.touchStartPoint = c.Events.getMousePosition(d);
			c.Events.fire(this, {
				type : c.TouchElement.EventTypes.onTouch,
				target : this,
				action : c.TouchElement.ActionTypes.touchStart,
				point : this.touchStartPoint
			})
		},
		onMouseMove : function(d) {
			nahf.preventDefault(d);
			c.Events.fire(this, {
				type : c.TouchElement.EventTypes.onTouch,
				target : this,
				action : c.TouchElement.ActionTypes.touchMove,
				point : c.Events.getMousePosition(d)
			})
		},
		onMouseUp : function(d) {
			nahf.preventDefault(d);
			if (this.captureSettings.move) {
				c.Events.remove(this.el, "mousemove", this.mouseMoveHandler)
			}
			c.Events.remove(this.el, "mouseup", this.mouseUpHandler);
			c.Events.remove(this.el, "mouseout", this.mouseOutHandler);
			this.touchEndPoint = c.Events.getMousePosition(d);
			c.Events.fire(this, {
				type : c.TouchElement.EventTypes.onTouch,
				target : this,
				action : c.TouchElement.ActionTypes.touchEnd,
				point : this.touchEndPoint
			});
			this.fireTouchEvent()
		},
		onMouseOut : function(d) {
			nahf.preventDefault(d);
			if (this.captureSettings.move) {
				c.Events.remove(this.el, "mousemove", this.mouseMoveHandler)
			}
			c.Events.remove(this.el, "mouseup", this.mouseUpHandler);
			c.Events.remove(this.el, "mouseout", this.mouseOutHandler);
			this.touchEndPoint = c.Events.getMousePosition(d);
			c.Events.fire(this, {
				type : c.TouchElement.EventTypes.onTouch,
				target : this,
				action : c.TouchElement.ActionTypes.touchEnd,
				point : this.touchEndPoint
			});
			this.fireTouchEvent()
		},
		onGestureStart : function(f) {
			nahf.preventDefault(f);
			var d = c.Events.getTouchEvent(f);
			c.Events.fire(this, {
				type : c.TouchElement.EventTypes.onTouch,
				target : this,
				action : c.TouchElement.ActionTypes.gestureStart,
				scale : d.scale,
				rotation : d.rotation
			})
		},
		onGestureChange : function(f) {
			nahf.preventDefault(f);
			var d = c.Events.getTouchEvent(f);
			c.Events.fire(this, {
				type : c.TouchElement.EventTypes.onTouch,
				target : this,
				action : c.TouchElement.ActionTypes.gestureChange,
				scale : d.scale,
				rotation : d.rotation
			})
		},
		onGestureEnd : function(f) {
			nahf.preventDefault(f);
			var d = c.Events.getTouchEvent(f);
			c.Events.fire(this, {
				type : c.TouchElement.EventTypes.onTouch,
				target : this,
				action : c.TouchElement.ActionTypes.gestureEnd,
				scale : d.scale,
				rotation : d.rotation
			})
		}
	})
}(window, window.klass, window.Jviewer.Util));
(function(c, a, d) {
	d.registerNamespace("Jviewer.Widget.PhotoSwipe.Image");
	var b = c.Jviewer.Widget.PhotoSwipe;
	b.Image.EventTypes = {
		onLoad : "onLoad",
		onError : "onError"
	}
}(window, window.klass, window.Jviewer.Util));
(function(c, a, d) {
	d.registerNamespace("Jviewer.Widget.PhotoSwipe.Image");
	var b = c.Jviewer.Widget.PhotoSwipe;
	b.Image.ImageClass = a({
		refObj : null,
		imageEl : null,
		src : null,
		caption : null,
		metaData : null,
		imageLoadHandler : null,
		imageErrorHandler : null,
		dispose : function() {
			var f, e;
			this.shrinkImage();
			for (f in this) {
				if (d.objectHasProperty(this, f)) {
					this[f] = null
				}
			}
		},
		initialize : function(g, h, f, e) {
			this.refObj = g;
			this.originalSrc = h;
			this.src = h;
			this.caption = f;
			this.metaData = e;
			this.imageEl = new c.Image();
			this.imageLoadHandler = this.onImageLoad.bind(this);
			this.imageErrorHandler = this.onImageError.bind(this)
		},
		load : function() {
			this.imageEl.originalSrc = d.coalesce(this.imageEl.originalSrc, "");
			if (this.imageEl.originalSrc === this.src) {
				if (this.imageEl.isError) {
					d.Events.fire(this, {
						type : b.Image.EventTypes.onError,
						target : this
					})
				} else {
					d.Events.fire(this, {
						type : b.Image.EventTypes.onLoad,
						target : this
					})
				}
				return
			}
			this.imageEl.isError = false;
			this.imageEl.isLoading = true;
			this.imageEl.naturalWidth = null;
			this.imageEl.naturalHeight = null;
			this.imageEl.isLandscape = false;
			this.imageEl.onload = this.imageLoadHandler;
			this.imageEl.onerror = this.imageErrorHandler;
			this.imageEl.onabort = this.imageErrorHandler;
			this.imageEl.originalSrc = this.src;
			this.imageEl.src = this.src
		},
		shrinkImage : function() {
			if (d.isNothing(this.imageEl)) {
				return
			}
			if (this.imageEl.src.indexOf(this.src) > -1) {
				this.imageEl.src = "";
				if (!d.isNothing(this.imageEl.parentNode)) {
					d.DOM.removeChild(this.imageEl, this.imageEl.parentNode)
				}
			}
		},
		onImageLoad : function(f) {
			this.imageEl.onload = null;
			this.imageEl.naturalWidth = d.coalesce(this.imageEl.naturalWidth,
					this.imageEl.width);
			this.imageEl.naturalHeight = d.coalesce(this.imageEl.naturalHeight,
					this.imageEl.height);
			this.imageEl.isLandscape = (this.imageEl.naturalWidth > this.imageEl.naturalHeight);
			this.imageEl.isLoading = false;
			d.Events.fire(this, {
				type : b.Image.EventTypes.onLoad,
				target : this
			})
		},
		onImageError : function(f) {
			try {
				this.imageEl.onload = null;
				this.imageEl.onerror = null;
				this.imageEl.onabort = null;
				this.imageEl.isLoading = false;
				this.imageEl.isError = true;
				d.Events.fire(this, {
					type : b.Image.EventTypes.onError,
					target : this
				})
			} catch (f) {
			}
		}
	})
}(window, window.klass, window.Jviewer.Util));
(function(c, a, d) {
	d.registerNamespace("Jviewer.Widget.PhotoSwipe.Cache");
	var b = c.Jviewer.Widget.PhotoSwipe;
	b.Cache.Mode = {
		normal : "normal",
		aggressive : "aggressive"
	};
	b.Cache.Functions = {
		getImageSource : function(e) {
			return e.href
		},
		getImageCaption : function(h) {
			if (h.nodeName === "IMG") {
				return d.DOM.getAttribute(h, "alt")
			}
			var g, f, e;
			for (g = 0, f = h.childNodes.length; g < f; g++) {
				e = h.childNodes[g];
				if (h.childNodes[g].nodeName === "IMG") {
					return d.DOM.getAttribute(e, "alt")
				}
			}
		},
		getImageMetaData : function(e) {
			return {}
		}
	}
}(window, window.klass, window.Jviewer.Util));
(function(c, a, d) {
	d.registerNamespace("Jviewer.Widget.PhotoSwipe.Cache");
	var b = c.Jviewer.Widget.PhotoSwipe;
	b.Cache.CacheClass = a({
		images : null,
		settings : null,
		dispose : function() {
			var g, f, e;
			if (!d.isNothing(this.images)) {
				for (f = 0, e = this.images.length; f < e; f++) {
					this.images[f].dispose()
				}
				this.images.length = 0
			}
			for (g in this) {
				if (d.objectHasProperty(this, g)) {
					this[g] = null
				}
			}
		},
		initialize : function(m, o) {
			var k, h, l, g, e, n, f;
			this.settings = o;
			this.images = [];
			for (k = 0, h = m.length; k < h; k++) {
				g = m[k];
				e = this.settings.getImageSource(g);
				n = this.settings.getImageCaption(g);
				f = this.settings.getImageMetaData(g);
				this.images.push(new b.Image.ImageClass(g, e, n, f))
			}
		},
		getImages : function(h) {
			var k, g, f = [], e;
			for (k = 0, g = h.length; k < g; k++) {
				e = this.images[h[k]];
				if (this.settings.cacheMode === b.Cache.Mode.aggressive) {
					e.cacheDoNotShrink = true
				}
				f.push(e)
			}
			if (this.settings.cacheMode === b.Cache.Mode.aggressive) {
				for (k = 0, g = this.images.length; k < g; k++) {
					e = this.images[k];
					if (!d.objectHasProperty(e, "cacheDoNotShrink")) {
						e.shrinkImage()
					} else {
						delete e.cacheDoNotShrink
					}
				}
			}
			return f
		}
	})
}(window, window.klass, window.Jviewer.Util,
		window.Jviewer.Widget.PhotoSwipe.Image));
(function(c, a, d) {
	d.registerNamespace("Jviewer.Widget.PhotoSwipe.DocumentOverlay");
	var b = c.Jviewer.Widget.PhotoSwipe;
	b.DocumentOverlay.CssClasses = {
		documentOverlay : "ps-document-overlay"
	}
}(window, window.klass, window.Jviewer.Util));
(function(c, a, d) {
	d.registerNamespace("Jviewer.Widget.PhotoSwipe.DocumentOverlay");
	var b = c.Jviewer.Widget.PhotoSwipe;
	b.DocumentOverlay.DocumentOverlayClass = a({
		el : null,
		settings : null,
		initialBodyHeight : null,
		dispose : function() {
			var e;
			d.Animation.stop(this.el);
			d.DOM.removeChild(this.el, this.el.parentNode);
			for (e in this) {
				if (d.objectHasProperty(this, e)) {
					this[e] = null
				}
			}
		},
		initialize : function(e) {
			this.settings = e;
			this.el = d.DOM.createElement("div", {
				"class" : b.DocumentOverlay.CssClasses.documentOverlay
			}, "");
			d.DOM.setStyle(this.el, {
				display : "block",
				position : "absolute",
				left : 0,
				top : 0,
				zIndex : this.settings.zIndex
			});
			d.DOM.hide(this.el);
			d.DOM.appendToBody(this.el);
			d.Animation.resetTranslate(this.el);
			this.initialBodyHeight = d.DOM.bodyOuterHeight()
		},
		resetPosition : function() {
			var f = d.DOM.windowWidth(), e = d.DOM.bodyOuterHeight() * 2;
			if (e < 1) {
				e = this.initialBodyHeight
			}
			if (d.DOM.windowHeight() > e) {
				e = d.DOM.windowHeight()
			}
			d.DOM.setStyle(this.el, {
				width : f,
				height : e,
				top : "0px"
			})
		},
		fadeIn : function(e, f) {
			this.resetPosition();
			d.DOM.setStyle(this.el, "opacity", 0);
			d.DOM.show(this.el);
			d.Animation.fadeIn(this.el, e, f)
		}
	})
}(window, window.klass, window.Jviewer.Util));
(function(c, a, d) {
	d.registerNamespace("Jviewer.Widget.PhotoSwipe.Carousel");
	var b = c.Jviewer.Widget.PhotoSwipe;
	b.Carousel.EventTypes = {
		onSlideByEnd : "PhotoSwipeCarouselOnSlideByEnd",
		onSlideshowStart : "PhotoSwipeCarouselOnSlideshowStart",
		onSlideshowStop : "PhotoSwipeCarouselOnSlideshowStop"
	};
	b.Carousel.CssClasses = {
		carousel : "ps-carousel",
		content : "ps-carousel-content",
		item : "ps-carousel-item",
		itemLoading : "ps-carousel-item-loading",
		itemError : "ps-carousel-item-error"
	};
	b.Carousel.SlideByAction = {
		previous : "previous",
		current : "current",
		next : "next"
	}
}(window, window.klass, window.Jviewer.Util));
(function(c, a, d) {
	d.registerNamespace("Jviewer.Widget.PhotoSwipe.Carousel");
	var b = c.Jviewer.Widget.PhotoSwipe;
	b.Carousel.CarouselClass = a({
		el : null,
		contentEl : null,
		settings : null,
		cache : null,
		slideByEndHandler : null,
		currentCacheIndex : null,
		isSliding : null,
		isSlideshowActive : null,
		lastSlideByAction : null,
		touchStartPoint : null,
		touchStartPosition : null,
		imageLoadHandler : null,
		imageErrorHandler : null,
		slideshowTimeout : null,
		dispose : function() {
			var g, f, e;
			for (f = 0, e = this.cache.images.length; f < e; f++) {
				d.Events.remove(this.cache.images[f],
						b.Image.EventTypes.onLoad, this.imageLoadHandler);
				d.Events.remove(this.cache.images[f],
						b.Image.EventTypes.onError, this.imageErrorHandler)
			}
			this.stopSlideshow();
			d.Animation.stop(this.el);
			d.DOM.removeChild(this.el, this.el.parentNode);
			for (g in this) {
				if (d.objectHasProperty(this, g)) {
					this[g] = null
				}
			}
		},
		initialize : function(e, f) {
			var h, j, g;
			this.cache = e;
			this.settings = f;
			this.slideByEndHandler = this.onSlideByEnd.bind(this);
			this.imageLoadHandler = this.onImageLoad.bind(this);
			this.imageErrorHandler = this.onImageError.bind(this);
			this.currentCacheIndex = 0;
			this.isSliding = false;
			this.isSlideshowActive = false;
			if (this.cache.images.length < 3) {
				this.settings.loop = false
			}
			this.el = d.DOM.createElement("div", {
				"class" : b.Carousel.CssClasses.carousel
			}, "");
			d.DOM.setStyle(this.el, {
				display : "block",
				position : "absolute",
				left : 0,
				top : 0,
				overflow : "hidden",
				zIndex : this.settings.zIndex
			});
			d.DOM.hide(this.el);
			this.contentEl = d.DOM.createElement("div", {
				"class" : b.Carousel.CssClasses.content
			}, "");
			d.DOM.setStyle(this.contentEl, {
				display : "block",
				position : "absolute",
				left : 0,
				top : 0
			});
			d.DOM.appendChild(this.contentEl, this.el);
			j = (e.images.length < 3) ? e.images.length : 3;
			for (h = 0; h < j; h++) {
				g = d.DOM.createElement("div", {
					"class" : b.Carousel.CssClasses.item + " "
							+ b.Carousel.CssClasses.item + "-" + h
				}, "");
				d.DOM.setAttribute(g, "style", "float: left;");
				d.DOM.setStyle(g, {
					display : "block",
					position : "relative",
					left : 0,
					top : 0,
					overflow : "hidden"
				});
				if (this.settings.margin > 0) {
					d.DOM.setStyle(g, {
						marginRight : this.settings.margin + "px"
					})
				}
				d.DOM.appendChild(g, this.contentEl)
			}
			d.DOM.appendToBody(this.el)
		},
		resetPosition : function() {
			var g = d.DOM.windowWidth(), t = d.DOM.windowHeight(), q = (this.settings.margin > 0) ? g
					+ this.settings.margin
					: g, r = d.DOM.find("." + b.Carousel.CssClasses.item,
					this.contentEl), e = q * r.length, o, n, s, l;
			var p = Jviewer.Util.Browser;
			var k = (p.iOS && p.ua.indexOf("OS 4") > -1) ? true : false;
			var h = (p.iOS && p.ua.indexOf("OS 5") > -1) ? true : false;
			var f = (p.iOS && p.ua.indexOf("OS 6") > -1) ? true : false;
			if (k && !p.iPad) {
				t = t + 61
			}
			if ((h || f) && !p.iPad) {
				var m = c.innerHeight - document.documentElement.clientHeight;
				t = t + m
			}
			d.DOM.setStyle(this.el, {
				top : d.DOM.windowScrollTop() + "px",
				width : g,
				height : t
			});
			d.DOM.setStyle(this.contentEl, {
				width : e,
				height : t
			});
			for (o = 0, n = r.length; o < n; o++) {
				s = r[o];
				d.DOM.setStyle(s, {
					width : g,
					height : t
				});
				l = d.DOM.find("img", s)[0];
				if (!d.isNothing(l)) {
					this.resetImagePosition(l)
				}
			}
			this.setContentLeftPosition()
		},
		resetImagePosition : function(g) {
			if (d.isNothing(g)) {
				return
			}
			var e = d.DOM.getAttribute(g, "src"), h, i, f, j, k, m = d.DOM
					.width(this.el), l = d.DOM.height(this.el);
			if (this.settings.imageScaleMethod === "fitNoUpscale") {
				i = g.naturalWidth;
				f = g.naturalHeight;
				if (i > m) {
					h = m / i;
					i = Math.round(i * h);
					f = Math.round(f * h)
				}
				if (f > l) {
					h = l / f;
					f = Math.round(f * h);
					i = Math.round(i * h)
				}
			} else {
				if (g.isLandscape) {
					h = m / g.naturalWidth
				} else {
					h = l / g.naturalHeight
				}
				i = Math.round(g.naturalWidth * h);
				f = Math.round(g.naturalHeight * h);
				if (this.settings.imageScaleMethod === "zoom") {
					h = 1;
					if (f < l) {
						h = l / f
					} else {
						if (i < m) {
							h = m / i
						}
					}
					if (h !== 1) {
						i = Math.round(i * h);
						f = Math.round(f * h)
					}
				} else {
					if (this.settings.imageScaleMethod === "fit") {
						h = 1;
						if (i > m) {
							h = m / i
						} else {
							if (f > l) {
								h = l / f
							}
						}
						if (h !== 1) {
							i = Math.round(i * h);
							f = Math.round(f * h)
						}
					}
				}
			}
			j = Math.round(((l - f) / 2)) + "px";
			k = Math.round(((m - i) / 2)) + "px";
			d.DOM.setStyle(g, {
				position : "absolute",
				width : i,
				height : f,
				top : j,
				left : k,
				display : "block"
			})
		},
		setContentLeftPosition : function() {
			var e = d.DOM.windowWidth(), g = this.getItemEls(), f = 0;
			if (this.settings.loop) {
				f = (e + this.settings.margin) * -1
			} else {
				if (this.currentCacheIndex === this.cache.images.length - 1) {
					f = ((g.length - 1) * (e + this.settings.margin)) * -1
				} else {
					if (this.currentCacheIndex > 0) {
						f = (e + this.settings.margin) * -1
					}
				}
			}
			d.DOM.setStyle(this.contentEl, {
				left : f + "px"
			})
		},
		show : function(f) {
			this.currentCacheIndex = f;
			this.resetPosition();
			this.setImages(false);
			d.DOM.show(this.el);
			d.Animation.resetTranslate(this.contentEl);
			var h = this.getItemEls(), g, e;
			for (g = 0, e = h.length; g < e; g++) {
				d.Animation.resetTranslate(h[g])
			}
			d.Events.fire(this, {
				type : b.Carousel.EventTypes.onSlideByEnd,
				target : this,
				action : b.Carousel.SlideByAction.current,
				cacheIndex : this.currentCacheIndex
			})
		},
		setImages : function(f) {
			var g, i = this.getItemEls(), e = this.currentCacheIndex + 1, h = this.currentCacheIndex - 1;
			if (this.settings.loop) {
				if (e > this.cache.images.length - 1) {
					e = 0
				}
				if (h < 0) {
					h = this.cache.images.length - 1
				}
				g = this.cache.getImages([ h, this.currentCacheIndex, e ]);
				if (!f) {
					this.addCacheImageToItemEl(g[1], i[1])
				}
				this.addCacheImageToItemEl(g[2], i[2]);
				this.addCacheImageToItemEl(g[0], i[0])
			} else {
				if (i.length === 1) {
					if (!f) {
						g = this.cache.getImages([ this.currentCacheIndex ]);
						this.addCacheImageToItemEl(g[0], i[0])
					}
				} else {
					if (i.length === 2) {
						if (this.currentCacheIndex === 0) {
							g = this.cache.getImages([ this.currentCacheIndex,
									this.currentCacheIndex + 1 ]);
							if (!f) {
								this.addCacheImageToItemEl(g[0], i[0])
							}
							this.addCacheImageToItemEl(g[1], i[1])
						} else {
							g = this.cache.getImages([
									this.currentCacheIndex - 1,
									this.currentCacheIndex ]);
							if (!f) {
								this.addCacheImageToItemEl(g[1], i[1])
							}
							this.addCacheImageToItemEl(g[0], i[0])
						}
					} else {
						if (this.currentCacheIndex === 0) {
							g = this.cache.getImages([ this.currentCacheIndex,
									this.currentCacheIndex + 1,
									this.currentCacheIndex + 2 ]);
							if (!f) {
								this.addCacheImageToItemEl(g[0], i[0])
							}
							this.addCacheImageToItemEl(g[1], i[1]);
							this.addCacheImageToItemEl(g[2], i[2])
						} else {
							if (this.currentCacheIndex === this.cache.images.length - 1) {
								g = this.cache.getImages([
										this.currentCacheIndex - 2,
										this.currentCacheIndex - 1,
										this.currentCacheIndex ]);
								if (!f) {
									this.addCacheImageToItemEl(g[2], i[2])
								}
								this.addCacheImageToItemEl(g[1], i[1]);
								this.addCacheImageToItemEl(g[0], i[0])
							} else {
								g = this.cache.getImages([
										this.currentCacheIndex - 1,
										this.currentCacheIndex,
										this.currentCacheIndex + 1 ]);
								if (!f) {
									this.addCacheImageToItemEl(g[1], i[1])
								}
								this.addCacheImageToItemEl(g[2], i[2]);
								this.addCacheImageToItemEl(g[0], i[0])
							}
						}
					}
				}
			}
		},
		addCacheImageToItemEl : function(e, f) {
			d.DOM.removeClass(f, b.Carousel.CssClasses.itemError);
			d.DOM.addClass(f, b.Carousel.CssClasses.itemLoading);
			d.DOM.removeChildren(f);
			d.DOM.setStyle(e.imageEl, {
				display : "none"
			});
			d.DOM.appendChild(e.imageEl, f);
			d.Animation.resetTranslate(e.imageEl);
			d.Events.add(e, b.Image.EventTypes.onLoad, this.imageLoadHandler);
			d.Events.add(e, b.Image.EventTypes.onError, this.imageErrorHandler);
			e.load()
		},
		slideCarousel : function(f, k, j) {
			if (this.isSliding) {
				return
			}
			var i = d.DOM.windowWidth() + this.settings.margin, h, g;
			j = d.coalesce(j, this.settings.slideSpeed);
			if (c.Math.abs(h) < 1) {
				return
			}
			switch (k) {
			case d.TouchElement.ActionTypes.swipeLeft:
				g = i * -1;
				break;
			case d.TouchElement.ActionTypes.swipeRight:
				g = i;
				break;
			default:
				h = f.x - this.touchStartPoint.x;
				if (c.Math.abs(h) > i / 2) {
					g = (h > 0) ? i : i * -1
				} else {
					g = 0
				}
				break
			}
			if (g < 0) {
				this.lastSlideByAction = b.Carousel.SlideByAction.next
			} else {
				if (g > 0) {
					this.lastSlideByAction = b.Carousel.SlideByAction.previous
				} else {
					this.lastSlideByAction = b.Carousel.SlideByAction.current
				}
			}
			if (this.lastSlideByAction === b.Carousel.SlideByAction.previous
					&& this.currentCacheIndex === 0) {
				this.settings.onPreviousEnd();
				g = 0;
				this.lastSlideByAction = b.Carousel.SlideByAction.current
			}
			if (this.lastSlideByAction === b.Carousel.SlideByAction.next
					&& this.currentCacheIndex === this.cache.images.length - 1) {
				this.settings.onNextEnd();
				g = 0;
				this.lastSlideByAction = b.Carousel.SlideByAction.current
			}
			try {
				if (!this.settings.loop) {
					if ((this.lastSlideByAction === b.Carousel.SlideByAction.previous && this.currentCacheIndex === 0)
							|| (this.lastSlideByAction === b.Carousel.SlideByAction.next && this.currentCacheIndex === this.cache.images.length - 1)) {
						g = 0;
						this.lastSlideByAction = b.Carousel.SlideByAction.current
					}
				}
			} catch (l) {
			}
			this.isSliding = true;
			try {
				this.doSlideCarousel(g, j)
			} catch (l) {
			}
		},
		moveCarousel : function(e) {
			if (this.isSliding) {
				return
			}
			if (!this.settings.enableDrag) {
				return
			}
			this.doMoveCarousel(e.x - this.touchStartPoint.x)
		},
		getItemEls : function() {
			return d.DOM.find("." + b.Carousel.CssClasses.item, this.contentEl)
		},
		previous : function() {
			this.stopSlideshow();
			this.slideCarousel({
				x : 0,
				y : 0
			}, d.TouchElement.ActionTypes.swipeRight,
					this.settings.nextPreviousSlideSpeed)
		},
		next : function() {
			this.stopSlideshow();
			this.slideCarousel({
				x : 0,
				y : 0
			}, d.TouchElement.ActionTypes.swipeLeft,
					this.settings.nextPreviousSlideSpeed)
		},
		slideshowNext : function() {
			this.slideCarousel({
				x : 0,
				y : 0
			}, d.TouchElement.ActionTypes.swipeLeft)
		},
		startSlideshow : function() {
			this.stopSlideshow();
			this.isSlideshowActive = true;
			this.slideshowTimeout = c.setTimeout(this.slideshowNext.bind(this),
					this.settings.slideshowDelay);
			d.Events.fire(this, {
				type : b.Carousel.EventTypes.onSlideshowStart,
				target : this
			})
		},
		stopSlideshow : function() {
			if (!d.isNothing(this.slideshowTimeout)) {
				c.clearTimeout(this.slideshowTimeout);
				this.slideshowTimeout = null;
				this.isSlideshowActive = false;
				d.Events.fire(this, {
					type : b.Carousel.EventTypes.onSlideshowStop,
					target : this
				})
			}
		},
		onSlideByEnd : function(f) {
			if (d.isNothing(this.isSliding)) {
				return
			}
			var g = this.getItemEls();
			this.isSliding = false;
			if (this.lastSlideByAction === b.Carousel.SlideByAction.next) {
				this.currentCacheIndex = this.currentCacheIndex + 1
			} else {
				if (this.lastSlideByAction === b.Carousel.SlideByAction.previous) {
					this.currentCacheIndex = this.currentCacheIndex - 1
				}
			}
			if (this.settings.loop) {
				if (this.lastSlideByAction === b.Carousel.SlideByAction.next) {
					d.DOM.appendChild(g[0], this.contentEl)
				} else {
					if (this.lastSlideByAction === b.Carousel.SlideByAction.previous) {
						d.DOM.insertBefore(g[g.length - 1], g[0],
								this.contentEl)
					}
				}
				if (this.currentCacheIndex < 0) {
					this.currentCacheIndex = this.cache.images.length - 1
				} else {
					if (this.currentCacheIndex === this.cache.images.length) {
						this.currentCacheIndex = 0
					}
				}
			} else {
				if (this.cache.images.length > 3) {
					if (this.currentCacheIndex > 1
							&& this.currentCacheIndex < this.cache.images.length - 2) {
						if (this.lastSlideByAction === b.Carousel.SlideByAction.next) {
							d.DOM.appendChild(g[0], this.contentEl)
						} else {
							if (this.lastSlideByAction === b.Carousel.SlideByAction.previous) {
								d.DOM.insertBefore(g[g.length - 1], g[0],
										this.contentEl)
							}
						}
					} else {
						if (this.currentCacheIndex === 1) {
							if (this.lastSlideByAction === b.Carousel.SlideByAction.previous) {
								d.DOM.insertBefore(g[g.length - 1], g[0],
										this.contentEl)
							}
						} else {
							if (this.currentCacheIndex === this.cache.images.length - 2) {
								if (this.lastSlideByAction === b.Carousel.SlideByAction.next) {
									d.DOM.appendChild(g[0], this.contentEl)
								}
							}
						}
					}
				}
			}
			if (this.lastSlideByAction !== b.Carousel.SlideByAction.current) {
				this.setContentLeftPosition();
				this.setImages(true)
			}
			d.Events.fire(this, {
				type : b.Carousel.EventTypes.onSlideByEnd,
				target : this,
				action : this.lastSlideByAction,
				cacheIndex : this.currentCacheIndex
			});
			if (this.isSlideshowActive) {
				if (this.lastSlideByAction !== b.Carousel.SlideByAction.current) {
					this.startSlideshow()
				} else {
					this.stopSlideshow()
				}
			}
		},
		onTouch : function(f, e) {
			this.stopSlideshow();
			switch (f) {
			case d.TouchElement.ActionTypes.touchStart:
				this.touchStartPoint = e;
				this.touchStartPosition = {
					x : c.parseInt(d.DOM.getStyle(this.contentEl, "left"), 0),
					y : c.parseInt(d.DOM.getStyle(this.contentEl, "top"), 0)
				};
				break;
			case d.TouchElement.ActionTypes.touchMove:
				this.moveCarousel(e);
				break;
			case d.TouchElement.ActionTypes.touchMoveEnd:
			case d.TouchElement.ActionTypes.swipeLeft:
			case d.TouchElement.ActionTypes.swipeRight:
				this.slideCarousel(e, f);
				break;
			case d.TouchElement.ActionTypes.tap:
				break;
			case d.TouchElement.ActionTypes.doubleTap:
				break
			}
		},
		onImageLoad : function(g) {
			var f = g.target;
			if (!d.isNothing(f.imageEl.parentNode)) {
				d.DOM.removeClass(f.imageEl.parentNode,
						b.Carousel.CssClasses.itemLoading);
				this.resetImagePosition(f.imageEl)
			}
			d.Events
					.remove(f, b.Image.EventTypes.onLoad, this.imageLoadHandler);
			d.Events.remove(f, b.Image.EventTypes.onError,
					this.imageErrorHandler);
		},
		onImageError : function(g) {
			var f = g.target;
			if (!d.isNothing(f.imageEl.parentNode)) {
				d.DOM.removeClass(f.imageEl.parentNode,
						b.Carousel.CssClasses.itemLoading);
				d.DOM.addClass(f.imageEl.parentNode,
						b.Carousel.CssClasses.itemError)
			}
			d.Events
					.remove(f, b.Image.EventTypes.onLoad, this.imageLoadHandler);
			d.Events.remove(f, b.Image.EventTypes.onError,
					this.imageErrorHandler)
		}
	})
}(window, window.klass, window.Jviewer.Util));
(function(d, a, e, b) {
	e.registerNamespace("Jviewer.Widget.PhotoSwipe.Carousel");
	var c = d.Jviewer.Widget.PhotoSwipe;
	c.Carousel.CarouselClass = c.Carousel.CarouselClass
			.extend({
				getStartingPos : function() {
					var f = this.touchStartPosition;
					if (e.isNothing(f)) {
						f = {
							x : d.parseInt(e.DOM.getStyle(this.contentEl,
									"left"), 0),
							y : d.parseInt(e.DOM
									.getStyle(this.contentEl, "top"), 0)
						}
					}
					return f
				},
				doMoveCarousel : function(g) {
					var f;
					if (e.Browser.isCSSTransformSupported) {
						f = {};
						f[e.Animation._transitionPrefix + "Property"] = "all";
						f[e.Animation._transitionPrefix + "Duration"] = "";
						f[e.Animation._transitionPrefix + "TimingFunction"] = "";
						f[e.Animation._transitionPrefix + "Delay"] = "0";
						f[e.Animation._transformLabel] = (e.Browser.is3dSupported) ? "translate3d("
								+ g + "px, 0px, 0px)"
								: "translate(" + g + "px, 0px)";
						e.DOM.setStyle(this.contentEl, f)
					} else {
						nahf.Fx.stop(this.contentEl);
						nahf.setStyle(this.contentEl, {
							left : this.getStartingPos().x + g + "px"
						})
					}
				},
				doSlideCarousel : function(i, h) {
					var f, g;
					if (h <= 0) {
						this.slideByEndHandler();
						return
					}
					if (e.Browser.isCSSTransformSupported) {
						g = e.coalesce(this.contentEl.style.webkitTransform,
								this.contentEl.style.MozTransform,
								this.contentEl.style.transform, "");
						if (g.indexOf("translate3d(" + i) === 0) {
							this.slideByEndHandler();
							return
						} else {
							if (g.indexOf("translate(" + i) === 0) {
								this.slideByEndHandler();
								return
							}
						}
						e.Animation.slideBy(this.contentEl, i, 0, h,
								this.slideByEndHandler,
								this.settings.slideTimingFunction)
					} else {
						f = {
							left : this.getStartingPos().x + i + "px"
						};
						if (this.settings.animationTimingFunction === "ease-out") {
							this.settings.animationTimingFunction = "easeOutQuad"
						}
						nahf.Fx.animate(this.contentEl, f, {
							easing : this.settings.animationTimingFunction,
							duration : this.settings.slideSpeed,
							callback : this.slideByEndHandler
						})
					}
				}
			})
}(window, window.klass, window.Jviewer.Util,
		window.Jviewer.Widget.PhotoSwipe.TouchElement));
(function(c, a, d) {
	d.registerNamespace("Jviewer.Widget.PhotoSwipe.Toolbar");
	var b = c.Jviewer.Widget.PhotoSwipe;
	b.Toolbar.CssClasses = {
		toolbar : "ps-toolbar",
		toolbarContent : "ps-toolbar-content",
		toolbarTop : "ps-toolbar-top",
		caption : "ps-caption",
		captionBottom : "ps-caption-bottom",
		captionContent : "ps-caption-content",
		close : "ps-toolbar-close",
		play : "ps-toolbar-play",
		previous : "ps-toolbar-previous",
		previousDisabled : "ps-toolbar-previous-disabled",
		next : "ps-toolbar-next",
		nextDisabled : "ps-toolbar-next-disabled"
	};
	b.Toolbar.ToolbarAction = {
		close : "close",
		play : "play",
		next : "next",
		previous : "previous",
		none : "none"
	};
	b.Toolbar.EventTypes = {
		onTap : "PhotoSwipeToolbarOnClick",
		onBeforeShow : "PhotoSwipeToolbarOnBeforeShow",
		onShow : "PhotoSwipeToolbarOnShow",
		onBeforeHide : "PhotoSwipeToolbarOnBeforeHide",
		onHide : "PhotoSwipeToolbarOnHide"
	};
	b.Toolbar.getToolbar = function() {
		return '<div class="' + b.Toolbar.CssClasses.close + '"><div class="'
				+ b.Toolbar.CssClasses.toolbarContent
				+ '"></div></div><div class="' + b.Toolbar.CssClasses.play
				+ '"><div class="' + b.Toolbar.CssClasses.toolbarContent
				+ '"></div></div><div class="' + b.Toolbar.CssClasses.previous
				+ '"><div class="' + b.Toolbar.CssClasses.toolbarContent
				+ '"></div></div><div class="' + b.Toolbar.CssClasses.next
				+ '"><div class="' + b.Toolbar.CssClasses.toolbarContent
				+ '"></div></div>'
	}
}(window, window.klass, window.Jviewer.Util));
(function(c, a, d) {
	d.registerNamespace("Jviewer.Widget.PhotoSwipe.Toolbar");
	var b = c.Jviewer.Widget.PhotoSwipe;
	b.Toolbar.ToolbarClass = a({
		toolbarEl : null,
		closeEl : null,
		playEl : null,
		previousEl : null,
		nextEl : null,
		captionEl : null,
		captionContentEl : null,
		currentCaption : null,
		settings : null,
		cache : null,
		timeout : null,
		isVisible : null,
		fadeOutHandler : null,
		touchStartHandler : null,
		touchMoveHandler : null,
		clickHandler : null,
		dispose : function() {
			var e;
			this.clearTimeout();
			this.removeEventHandlers();
			d.Animation.stop(this.toolbarEl);
			d.Animation.stop(this.captionEl);
			d.DOM.removeChild(this.toolbarEl, this.toolbarEl.parentNode);
			d.DOM.removeChild(this.captionEl, this.captionEl.parentNode);
			for (e in this) {
				if (d.objectHasProperty(this, e)) {
					this[e] = null
				}
			}
		},
		initialize : function(f, g) {
			var e;
			this.settings = g;
			this.cache = f;
			this.isVisible = false;
			this.fadeOutHandler = this.onFadeOut.bind(this);
			this.touchStartHandler = this.onTouchStart.bind(this);
			this.touchMoveHandler = this.onTouchMove.bind(this);
			this.clickHandler = this.onClick.bind(this);
			e = b.Toolbar.CssClasses.toolbar;
			if (this.settings.captionAndToolbarFlipPosition) {
				e = e + " " + b.Toolbar.CssClasses.toolbarTop
			}
			this.toolbarEl = d.DOM.createElement("div", {
				"class" : e
			}, this.settings.getToolbar());
			d.DOM.setStyle(this.toolbarEl, {
				left : 0,
				position : "absolute",
				overflow : "hidden",
				zIndex : this.settings.zIndex
			});
			d.DOM.appendToBody(this.toolbarEl);
			d.DOM.hide(this.toolbarEl);
			this.closeEl = d.DOM.find("." + b.Toolbar.CssClasses.close,
					this.toolbarEl)[0];
			if (this.settings.preventHide && !d.isNothing(this.closeEl)) {
				d.DOM.hide(this.closeEl)
			}
			this.playEl = d.DOM.find("." + b.Toolbar.CssClasses.play,
					this.toolbarEl)[0];
			if (this.settings.preventSlideshow && !d.isNothing(this.playEl)) {
				d.DOM.hide(this.playEl)
			}
			this.nextEl = d.DOM.find("." + b.Toolbar.CssClasses.next,
					this.toolbarEl)[0];
			this.previousEl = d.DOM.find("." + b.Toolbar.CssClasses.previous,
					this.toolbarEl)[0];
			e = b.Toolbar.CssClasses.caption;
			if (this.settings.captionAndToolbarFlipPosition) {
				e = e + " " + b.Toolbar.CssClasses.captionBottom
			}
			this.captionEl = d.DOM.createElement("div", {
				"class" : e
			}, "");
			d.DOM.setStyle(this.captionEl, {
				left : 0,
				position : "absolute",
				overflow : "hidden",
				zIndex : this.settings.zIndex
			});
			d.DOM.appendToBody(this.captionEl);
			d.DOM.hide(this.captionEl);
			this.captionContentEl = d.DOM.createElement("div", {
				"class" : b.Toolbar.CssClasses.captionContent
			}, "");
			d.DOM.appendChild(this.captionContentEl, this.captionEl);
			this.addEventHandlers()
		},
		resetPosition : function() {
			var e, f;
			if (this.settings.captionAndToolbarFlipPosition) {
				e = d.DOM.windowScrollTop();
				f = (d.DOM.windowScrollTop() + d.DOM.windowHeight())
						- d.DOM.height(this.captionEl)
			} else {
				e = (d.DOM.windowScrollTop() + d.DOM.windowHeight())
						- d.DOM.height(this.toolbarEl);
				f = d.DOM.windowScrollTop()
			}
			d.DOM.setStyle(this.toolbarEl, {
				top : e + "px",
				width : d.DOM.windowWidth()
			});
			d.DOM.setStyle(this.captionEl, {
				top : f + "px",
				width : d.DOM.windowWidth()
			})
		},
		toggleVisibility : function(e) {
			if (this.isVisible) {
				this.fadeOut()
			} else {
				this.show(e)
			}
		},
		show : function(e) {
			d.Animation.stop(this.toolbarEl);
			d.Animation.stop(this.captionEl);
			this.resetPosition();
			this.setToolbarStatus(e);
			d.Events.fire(this, {
				type : b.Toolbar.EventTypes.onBeforeShow,
				target : this
			});
			this.showToolbar();
			this.setCaption(e);
			this.showCaption();
			this.isVisible = true;
			this.setTimeout();
			d.Events.fire(this, {
				type : b.Toolbar.EventTypes.onShow,
				target : this
			})
		},
		setTimeout : function() {
			if (this.settings.captionAndToolbarAutoHideDelay > 0) {
				this.clearTimeout();
				this.timeout = c.setTimeout(this.fadeOut.bind(this),
						this.settings.captionAndToolbarAutoHideDelay)
			}
		},
		clearTimeout : function() {
			if (!d.isNothing(this.timeout)) {
				c.clearTimeout(this.timeout);
				this.timeout = null
			}
		},
		fadeOut : function() {
			this.clearTimeout();
			d.Events.fire(this, {
				type : b.Toolbar.EventTypes.onBeforeHide,
				target : this
			});
			d.Animation.fadeOut(this.toolbarEl, this.settings.fadeOutSpeed);
			d.Animation.fadeOut(this.captionEl, this.settings.fadeOutSpeed,
					this.fadeOutHandler);
			this.isVisible = false
		},
		addEventHandlers : function() {
			if (d.Browser.isTouchSupported) {
				if (!d.Browser.blackberry) {
					d.Events.add(this.toolbarEl, "touchstart",
							this.touchStartHandler)
				}
				d.Events
						.add(this.toolbarEl, "touchmove", this.touchMoveHandler);
				d.Events
						.add(this.captionEl, "touchmove", this.touchMoveHandler)
			}
			d.Events.add(this.toolbarEl, "click", this.clickHandler)
		},
		removeEventHandlers : function() {
			if (d.Browser.isTouchSupported) {
				if (!d.Browser.blackberry) {
					d.Events.remove(this.toolbarEl, "touchstart",
							this.touchStartHandler)
				}
				d.Events.remove(this.toolbarEl, "touchmove",
						this.touchMoveHandler);
				d.Events.remove(this.captionEl, "touchmove",
						this.touchMoveHandler)
			}
			d.Events.remove(this.toolbarEl, "click", this.clickHandler)
		},
		handleTap : function(g) {
			this.clearTimeout();
			var f;
			if (g.target === this.nextEl
					|| d.DOM.isChildOf(g.target, this.nextEl)) {
				f = b.Toolbar.ToolbarAction.next
			} else {
				if (g.target === this.previousEl
						|| d.DOM.isChildOf(g.target, this.previousEl)) {
					f = b.Toolbar.ToolbarAction.previous
				} else {
					if (g.target === this.closeEl
							|| d.DOM.isChildOf(g.target, this.closeEl)) {
						f = b.Toolbar.ToolbarAction.close
					} else {
						if (g.target === this.playEl
								|| d.DOM.isChildOf(g.target, this.playEl)) {
							f = b.Toolbar.ToolbarAction.play
						}
					}
				}
			}
			this.setTimeout();
			if (d.isNothing(f)) {
				f = b.Toolbar.ToolbarAction.none
			}
			d.Events.fire(this, {
				type : b.Toolbar.EventTypes.onTap,
				target : this,
				action : f,
				tapTarget : g.target
			})
		},
		setCaption : function(e) {
			d.DOM.removeChildren(this.captionContentEl);
			this.currentCaption = d.coalesce(this.cache.images[e].caption,
					"\u00A0");
			return
		},
		showToolbar : function() {
			d.DOM.setStyle(this.toolbarEl, {
				opacity : this.settings.captionAndToolbarOpacity
			});
			d.DOM.show(this.toolbarEl)
		},
		showCaption : function() {
			if (this.currentCaption === ""
					|| this.captionContentEl.childNodes.length < 1) {
				if (!this.settings.captionAndToolbarShowEmptyCaptions) {
					d.DOM.hide(this.captionEl);
					return
				}
			}
			d.DOM.setStyle(this.captionEl, {
				opacity : this.settings.captionAndToolbarOpacity
			});
			d.DOM.show(this.captionEl)
		},
		setToolbarStatus : function(e) {
			if (this.settings.loop) {
				return
			}
			if (e > 0 && e < this.cache.images.length - 1) {
				d.DOM.removeClass(this.previousEl,
						b.Toolbar.CssClasses.previousDisabled);
				d.DOM.removeClass(this.nextEl,
						b.Toolbar.CssClasses.nextDisabled);
				return
			}
			if (e === 0) {
				if (!d.isNothing(this.previousEl)) {
					d.DOM.addClass(this.previousEl,
							b.Toolbar.CssClasses.previousDisabled)
				}
			}
			if (e === this.cache.images.length - 1) {
				if (!d.isNothing(this.nextEl)) {
					d.DOM.addClass(this.nextEl,
							b.Toolbar.CssClasses.nextDisabled)
				}
			}
		},
		onFadeOut : function() {
			d.DOM.hide(this.toolbarEl);
			d.DOM.hide(this.captionEl);
			d.Events.fire(this, {
				type : b.Toolbar.EventTypes.onHide,
				target : this
			})
		},
		onTouchStart : function(f) {
			f.preventDefault();
			d.Events.remove(this.toolbarEl, "click", this.clickHandler);
			this.handleTap(f)
		},
		onTouchMove : function(f) {
			f.preventDefault()
		},
		onClick : function(f) {
			f.preventDefault();
			this.handleTap(f)
		}
	})
}(window, window.klass, window.Jviewer.Util));
(function(c, a, d) {
	d.registerNamespace("Jviewer.Widget.PhotoSwipe.UILayer");
	var b = c.Jviewer.Widget.PhotoSwipe;
	b.UILayer.CssClasses = {
		uiLayer : "ps-uilayer"
	}
}(window, window.klass, window.Jviewer.Util));
(function(c, a, d) {
	d.registerNamespace("Jviewer.Widget.PhotoSwipe.UILayer");
	var b = c.Jviewer.Widget.PhotoSwipe;
	b.UILayer.UILayerClass = d.TouchElement.TouchElementClass.extend({
		el : null,
		settings : null,
		dispose : function() {
			var e;
			this.removeEventHandlers();
			d.DOM.removeChild(this.el, this.el.parentNode);
			for (e in this) {
				if (d.objectHasProperty(this, e)) {
					this[e] = null
				}
			}
		},
		initialize : function(e) {
			this.settings = e;
			this.el = d.DOM.createElement("div", {
				"class" : b.UILayer.CssClasses.uiLayer
			}, "");
			d.DOM.setStyle(this.el, {
				display : "block",
				position : "absolute",
				left : 0,
				top : 0,
				overflow : "hidden",
				zIndex : this.settings.zIndex,
				opacity : 0
			});
			d.DOM.hide(this.el);
			d.DOM.appendToBody(this.el);
			this.supr(this.el, {
				swipe : true,
				move : true,
				gesture : true,
				doubleTap : true
			})
		},
		resetPosition : function() {
			d.DOM.setStyle(this.el, {
				top : d.DOM.windowScrollTop() + "px",
				width : d.DOM.windowWidth(),
				height : d.DOM.windowHeight()
			})
		},
		show : function() {
			this.resetPosition();
			d.DOM.show(this.el);
			this.addEventHandlers()
		},
		addEventHandlers : function() {
			this.supr()
		},
		removeEventHandlers : function() {
			this.supr()
		}
	})
}(window, window.klass, window.Jviewer.Util));
(function(c, a, d) {
	d.registerNamespace("Jviewer.Widget.PhotoSwipe.ZoomPanRotate");
	var b = c.Jviewer.Widget.PhotoSwipe;
	b.ZoomPanRotate.CssClasses = {
		zoomPanRotate : "ps-zoom-pan-rotate"
	};
	b.ZoomPanRotate.EventTypes = {
		onTransform : "PhotoSwipeZoomPanRotateOnTransform"
	}
}(window, window.klass, window.Jviewer.Util));
(function(c, a, d) {
	d.registerNamespace("Jviewer.Widget.PhotoSwipe.ZoomPanRotate");
	var b = c.Jviewer.Widget.PhotoSwipe;
	b.ZoomPanRotate.ZoomPanRotateClass = a({
		el : null,
		settings : null,
		containerEl : null,
		imageEl : null,
		transformSettings : null,
		panStartingPoint : null,
		transformEl : null,
		dispose : function() {
			var e;
			$$(".ps-carousel-content")[0].style.display = "block";
			d.DOM.removeChild(this.el, this.el.parentNode);
			for (e in this) {
				if (d.objectHasProperty(this, e)) {
					this[e] = null
				}
			}
		},
		initialize : function(f, e, g) {
			this.settings = f;
			$$(".ps-carousel-content")[0].style.display = "none";
			this.imageEl = e.imageEl.cloneNode(false);
			d.DOM.setStyle(this.imageEl, {
				zIndex : 1
			});
			this.transformSettings = {
				startingScale : 1,
				scale : 1,
				startingRotation : 0,
				rotation : 0,
				startingTranslateX : 0,
				startingTranslateY : 0,
				translateX : 0,
				translateY : 0
			};
			this.el = d.DOM.createElement("div", {
				"class" : b.ZoomPanRotate.CssClasses.zoomPanRotate
			}, "");
			d.DOM.setStyle(this.el, {
				left : 0,
				top : d.DOM.windowScrollTop() + "px",
				position : "absolute",
				width : d.DOM.windowWidth(),
				height : d.DOM.windowHeight(),
				zIndex : this.settings.zIndex,
				display : "block"
			});
			d.DOM.insertBefore(this.el, g.el, document.body);
			if (d.Browser.iOS) {
				this.containerEl = d.DOM.createElement("div");
				d.DOM.setStyle(this.containerEl, {
					left : 0,
					top : 0,
					width : d.DOM.windowWidth(),
					height : d.DOM.windowHeight(),
					position : "absolute",
					zIndex : 1
				});
				d.DOM.appendChild(this.imageEl, this.containerEl);
				d.DOM.appendChild(this.containerEl, this.el);
				d.Animation.resetTranslate(this.containerEl);
				d.Animation.resetTranslate(this.imageEl);
				this.transformEl = this.containerEl
			} else {
				d.DOM.appendChild(this.imageEl, this.el);
				this.transformEl = this.imageEl
			}
		},
		setStartingTranslateFromCurrentTransform : function() {
			var e = d.coalesce(this.transformEl.style.webkitTransform,
					this.transformEl.style.MozTransform,
					this.transformEl.style.transform), f;
			if (!d.isNothing(e)) {
				f = e.match(/translate\((.*?)\)/);
				if (!d.isNothing(f)) {
					f = f[1].split(", ");
					this.transformSettings.startingTranslateX = c.parseInt(
							f[0], 10);
					this.transformSettings.startingTranslateY = c.parseInt(
							f[1], 10)
				}
			}
		},
		getScale : function(f) {
			var e = this.transformSettings.startingScale * f;
			if (this.settings.minUserZoom !== 0
					&& e < this.settings.minUserZoom) {
				e = this.settings.minUserZoom
			} else {
				if (this.settings.maxUserZoom !== 0
						&& e > this.settings.maxUserZoom) {
					e = this.settings.maxUserZoom
				}
			}
			return e
		},
		setStartingScaleAndRotation : function(f, e) {
			this.transformSettings.startingScale = this.getScale(f);
			this.transformSettings.startingRotation = (this.transformSettings.startingRotation + e) % 360
		},
		zoomRotate : function(f, e) {
			this.transformSettings.scale = this.getScale(f);
			this.transformSettings.rotation = this.transformSettings.startingRotation
					+ e;
			this.applyTransform()
		},
		panStart : function(e) {
			this.setStartingTranslateFromCurrentTransform();
			this.panStartingPoint = {
				x : e.x,
				y : e.y
			}
		},
		pan : function(e) {
			var g = e.x - this.panStartingPoint.x, f = e.y
					- this.panStartingPoint.y, h = g
					/ this.transformSettings.scale, i = f
					/ this.transformSettings.scale;
			this.transformSettings.translateX = this.transformSettings.startingTranslateX
					+ h;
			this.transformSettings.translateY = this.transformSettings.startingTranslateY
					+ i;
			this.applyTransform()
		},
		zoomAndPanToPoint : function(j, e) {
			this.panStart({
				x : d.DOM.windowWidth() / 2,
				y : d.DOM.windowHeight() / 2
			});
			var g = e.x - this.panStartingPoint.x, f = e.y
					- this.panStartingPoint.y, h = g
					/ this.transformSettings.scale, i = f
					/ this.transformSettings.scale;
			this.transformSettings.translateX = (this.transformSettings.startingTranslateX + h)
					* -1;
			this.transformSettings.translateY = (this.transformSettings.startingTranslateY + i)
					* -1;
			this.setStartingScaleAndRotation(j, 0);
			this.transformSettings.scale = this.transformSettings.startingScale;
			this.transformSettings.rotation = 0;
			this.applyTransform()
		},
		applyTransform : function() {
			var h = this.transformSettings.rotation % 360, g = c.parseInt(
					this.transformSettings.translateX, 10), f = c.parseInt(
					this.transformSettings.translateY, 10), e = "scale("
					+ this.transformSettings.scale + ") rotate(" + h
					+ "deg) translate(" + g + "px, " + f + "px)";
			d.DOM.setStyle(this.transformEl, {
				webkitTransform : e,
				MozTransform : e,
				msTransform : e,
				transform : e
			});
			d.Events.fire(this, {
				target : this,
				type : b.ZoomPanRotate.EventTypes.onTransform,
				scale : this.transformSettings.scale,
				rotation : this.transformSettings.rotation,
				rotationDegs : h,
				translateX : g,
				translateY : f
			})
		}
	})
}(window, window.klass, window.Jviewer.Util));
(function(b, c) {
	c.registerNamespace("Jviewer.Widget.PhotoSwipe");
	var a = b.Jviewer.Widget.PhotoSwipe;
	a.CssClasses = {
		buildingBody : "ps-building",
		activeBody : "ps-active"
	};
	a.EventTypes = {
		onBeforeShow : "PhotoSwipeOnBeforeShow",
		onShow : "PhotoSwipeOnShow",
		onBeforeHide : "PhotoSwipeOnBeforeHide",
		onHide : "PhotoSwipeOnHide",
		onDisplayImage : "PhotoSwipeOnDisplayImage",
		onResetPosition : "PhotoSwipeOnResetPosition",
		onSlideshowStart : "PhotoSwipeOnSlideshowStart",
		onSlideshowStop : "PhotoSwipeOnSlideshowStop",
		onTouch : "PhotoSwipeOnTouch",
		onBeforeCaptionAndToolbarShow : "PhotoSwipeOnBeforeCaptionAndToolbarShow",
		onCaptionAndToolbarShow : "PhotoSwipeOnCaptionAndToolbarShow",
		onBeforeCaptionAndToolbarHide : "PhotoSwipeOnBeforeCaptionAndToolbarHide",
		onCaptionAndToolbarHide : "PhotoSwipeOnCaptionAndToolbarHide",
		onToolbarTap : "PhotoSwipeOnToolbarTap",
		onBeforeZoomPanRotateShow : "PhotoSwipeOnBeforeZoomPanRotateShow",
		onZoomPanRotateShow : "PhotoSwipeOnZoomPanRotateShow",
		onBeforeZoomPanRotateHide : "PhotoSwipeOnBeforeZoomPanRotateHide",
		onZoomPanRotateHide : "PhotoSwipeOnZoomPanRotateHide",
		onZoomPanRotateTransform : "PhotoSwipeOnZoomPanRotateTransform"
	};
	a.instances = [];
	a.activeInstance = null;
	a.setActivateInstance = function(d) {
		if (!c.isNothing(a.activeInstance)) {
			throw "Jviewer.PhotoSwipe.activateInstance: Unable to active instance as another instance is already active"
		}
		a.activeInstance = d
	};
	a.unsetActivateInstance = function() {
		a.activeInstance = null
	};
	a.attach = function(e, g, l) {
		var h, f, d, k;
		d = a.createInstance(e, g, l);
		for (h = 0, f = e.length; h < f; h++) {
			k = e[h];
			if (!c.isNothing(k.nodeType)) {
				if (k.nodeType === 1) {
					k.__photoSwipeClickHandler = a.onTriggerElementClick
							.bind(d);
					c.Events.remove(k, "click", k.__photoSwipeClickHandler);
					c.Events.add(k, "click", k.__photoSwipeClickHandler)
				}
			}
		}
		return d
	};
	a.detatch = function(d) {
		var f, e, g;
		for (f = 0, e = d.originalImages.length; f < e; f++) {
			g = d.originalImages[f];
			if (!c.isNothing(g.nodeType)) {
				if (g.nodeType === 1) {
					c.Events.remove(g, "click", g.__photoSwipeClickHandler);
					delete g.__photoSwipeClickHandler
				}
			}
		}
		a.disposeInstance(d)
	};
	a.createInstance = function(e, f, j) {
		var g, d, h;
		if (c.isNothing(e)) {
			throw "Jviewer.PhotoSwipe.attach: No images passed."
		}
		if (!c.isLikeArray(e)) {
			throw "Jviewer.PhotoSwipe.createInstance: Images must be an array of elements or image urls."
		}
		if (e.length < 1) {
			throw "Jviewer.PhotoSwipe.createInstance: No images to passed."
		}
		f = c.coalesce(f, {});
		d = a.getInstance(j);
		if (c.isNothing(d)) {
			d = new a.PhotoSwipeClass(e, f, j);
			a.instances.push(d)
		} else {
			throw 'Jviewer.PhotoSwipe.createInstance: Instance with id "' + j
					+ ' already exists."'
		}
		return d
	};
	a.disposeInstance = function(d) {
		var e = a.getInstanceIndex(d);
		if (e < 0) {
			throw "Jviewer.PhotoSwipe.disposeInstance: Unable to find instance to dispose."
		}
		d.dispose();
		a.instances.splice(e, 1);
		d = null
	};
	a.onTriggerElementClick = function(f) {
		nahf.preventDefault(f);
		var d = this;
		d.show(f.currentTarget)
	};
	a.getInstance = function(g) {
		var f, e, d;
		for (f = 0, e = a.instances.length; f < e; f++) {
			d = a.instances[f];
			if (d.id === g) {
				return d
			}
		}
		return null
	};
	a.getInstanceIndex = function(d) {
		var g, f, e = -1;
		for (g = 0, f = a.instances.length; g < f; g++) {
			if (a.instances[g] === d) {
				e = g;
				break
			}
		}
		return e
	}
}(window, window.Jviewer.Util));
(function(f, g, i, j, e, h, d, k, c) {
	i.registerNamespace("Jviewer.Widget.PhotoSwipe");
	var a = f.Jviewer.Widget.PhotoSwipe;
	var b = f.Jviewer.config;
	a.PhotoSwipeClass = g({
		id : null,
		settings : null,
		isBackEventSupported : null,
		backButtonClicked : null,
		currentIndex : null,
		originalImages : null,
		mouseWheelStartTime : null,
		windowDimensions : null,
		cache : null,
		documentOverlay : null,
		carousel : null,
		uiLayer : null,
		toolbar : null,
		zoomPanRotate : null,
		windowOrientationChangeHandler : null,
		windowScrollHandler : null,
		windowHashChangeHandler : null,
		keyDownHandler : null,
		windowOrientationEventName : null,
		uiLayerTouchHandler : null,
		carouselSlideByEndHandler : null,
		carouselSlideshowStartHandler : null,
		carouselSlideshowStopHandler : null,
		toolbarTapHandler : null,
		toolbarBeforeShowHandler : null,
		toolbarShowHandler : null,
		toolbarBeforeHideHandler : null,
		toolbarHideHandler : null,
		mouseWheelHandler : null,
		zoomPanRotateTransformHandler : null,
		dispose : function() {
			var l;
			i.Events.remove(this, a.EventTypes.onBeforeShow);
			i.Events.remove(this, a.EventTypes.onShow);
			i.Events.remove(this, a.EventTypes.onBeforeHide);
			i.Events.remove(this, a.EventTypes.onHide);
			i.Events.remove(this, a.EventTypes.onDisplayImage);
			i.Events.remove(this, a.EventTypes.onResetPosition);
			i.Events.remove(this, a.EventTypes.onSlideshowStart);
			i.Events.remove(this, a.EventTypes.onSlideshowStop);
			i.Events.remove(this, a.EventTypes.onTouch);
			i.Events.remove(this, a.EventTypes.onBeforeCaptionAndToolbarShow);
			i.Events.remove(this, a.EventTypes.onCaptionAndToolbarShow);
			i.Events.remove(this, a.EventTypes.onBeforeCaptionAndToolbarHide);
			i.Events.remove(this, a.EventTypes.onCaptionAndToolbarHide);
			i.Events.remove(this, a.EventTypes.onZoomPanRotateTransform);
			this.removeEventHandlers();
			if (!i.isNothing(this.documentOverlay)) {
				this.documentOverlay.dispose()
			}
			if (!i.isNothing(this.carousel)) {
				this.carousel.dispose()
			}
			if (!i.isNothing(this.uiLayer)) {
				this.uiLayer.dispose()
			}
			if (!i.isNothing(this.toolbar)) {
				this.toolbar.dispose()
			}
			this.destroyZoomPanRotate();
			if (!i.isNothing(this.cache)) {
				this.cache.dispose()
			}
			for (l in this) {
				if (i.objectHasProperty(this, l)) {
					this[l] = null
				}
			}
		},
		initialize : function(l, m, n) {
			if (i.isNothing(n)) {
				this.id = "PhotoSwipe" + new Date().getTime().toString()
			} else {
				this.id = n
			}
			this.originalImages = l;
			if (i.Browser.android) {
				if (f.navigator.userAgent.match(/Android (\d+.\d+)/).toString()
						.replace(/^.*\,/, "") >= 2.1) {
					this.isBackEventSupported = true
				}
			}
			if (!this.isBackEventSupported) {
				this.isBackEventSupported = i.objectHasProperty(f,
						"onhashchange")
			}
			this.settings = {
				fadeInSpeed : 250,
				fadeOutSpeed : 250,
				preventHide : false,
				preventSlideshow : false,
				zIndex : 1000,
				backButtonHideEnabled : true,
				enableKeyboard : (i.isNothing(b.enableKeyboard) ? true
						: b.enableKeyboard),
				enableMouseWheel : true,
				mouseWheelSpeed : 350,
				autoStartSlideshow : false,
				jQueryMobile : (!i.isNothing(f.jQuery) && !i
						.isNothing(f.jQuery.mobile)),
				jQueryMobileDialogHash : "&ui-state=dialog",
				loop : true,
				slideSpeed : 250,
				nextPreviousSlideSpeed : 0,
				enableDrag : true,
				swipeThreshold : 50,
				swipeTimeThreshold : 250,
				slideTimingFunction : "ease-out",
				slideshowDelay : 3000,
				doubleTapSpeed : 250,
				margin : 20,
				imageScaleMethod : "fit",
				captionAndToolbarHide : false,
				captionAndToolbarFlipPosition : false,
				captionAndToolbarAutoHideDelay : 5000,
				captionAndToolbarOpacity : b.opacity,
				captionAndToolbarShowEmptyCaptions : true,
				getToolbar : a.Toolbar.getToolbar,
				allowUserZoom : true,
				allowRotationOnUserZoom : false,
				maxUserZoom : 5,
				minUserZoom : 0.5,
				doubleTapZoomLevel : 2.5,
				onPreviousEnd : function() {
				},
				onNextEnd : function() {
				},
				getImageSource : a.Cache.Functions.getImageSource,
				getImageCaption : a.Cache.Functions.getImageCaption,
				getImageMetaData : a.Cache.Functions.getImageMetaData,
				cacheMode : a.Cache.Mode.normal
			};
			i.extend(this.settings, m);
			if (this.settings.preventHide) {
				this.settings.backButtonHideEnabled = false
			}
			this.cache = new j.CacheClass(l, this.settings)
		},
		show : function(n) {
			var m, l;
			if (i.isNumber(n)) {
				this.currentIndex = n
			} else {
				this.currentIndex = -1;
				for (m = 0, l = this.originalImages.length; m < l; m++) {
					if (this.originalImages[m] === n) {
						this.currentIndex = m;
						break
					}
				}
			}
			if (this.currentIndex < 0
					|| this.currentIndex > this.originalImages.length - 1) {
				throw "Jviewer.PhotoSwipe.PhotoSwipeClass.show: Starting index out of range"
			}
			this.windowDimensions = this.getWindowDimensions();
			a.setActivateInstance(this);
			i.DOM.addClass(f.document.body, a.CssClasses.buildingBody);
			this.createComponents();
			i.Events.fire(this, {
				type : a.EventTypes.onBeforeShow,
				target : this
			});
			this.documentOverlay.fadeIn(this.settings.fadeInSpeed,
					this.onDocumentOverlayFadeIn.bind(this))
		},
		getWindowDimensions : function() {
			return {
				width : i.DOM.windowWidth(),
				height : i.DOM.windowHeight()
			}
		},
		createComponents : function() {
			this.documentOverlay = new e.DocumentOverlayClass(this.settings);
			this.carousel = new h.CarouselClass(this.cache, this.settings);
			this.uiLayer = new k.UILayerClass(this.settings);
			if (!this.settings.captionAndToolbarHide) {
				this.toolbar = new d.ToolbarClass(this.cache, this.settings)
			}
		},
		resetPosition : function() {
			var l = this.getWindowDimensions();
			if (l.width === this.windowDimensions.width
					&& l.height === this.windowDimensions.height) {
				return
			}
			this.windowDimensions = l;
			this.destroyZoomPanRotate();
			this.documentOverlay.resetPosition();
			this.carousel.resetPosition();
			if (!i.isNothing(this.toolbar)) {
				this.toolbar.resetPosition()
			}
			this.uiLayer.resetPosition();
			i.Events.fire(this, {
				type : a.EventTypes.onResetPosition,
				target : this
			})
		},
		addEventHandler : function(m, l) {
			i.Events.add(this, m, l)
		},
		addEventHandlers : function() {
			if (i.isNothing(this.windowOrientationChangeHandler)) {
				this.windowOrientationChangeHandler = this.onWindowOrientationChange
						.bind(this);
				this.windowScrollHandler = this.onWindowScroll.bind(this);
				this.keyDownHandler = this.onKeyDown.bind(this);
				this.windowHashChangeHandler = this.onWindowHashChange
						.bind(this);
				this.uiLayerTouchHandler = this.onUILayerTouch.bind(this);
				this.carouselSlideByEndHandler = this.onCarouselSlideByEnd
						.bind(this);
				this.carouselSlideshowStartHandler = this.onCarouselSlideshowStart
						.bind(this);
				this.carouselSlideshowStopHandler = this.onCarouselSlideshowStop
						.bind(this);
				this.toolbarTapHandler = this.onToolbarTap.bind(this);
				this.toolbarBeforeShowHandler = this.onToolbarBeforeShow
						.bind(this);
				this.toolbarShowHandler = this.onToolbarShow.bind(this);
				this.toolbarBeforeHideHandler = this.onToolbarBeforeHide
						.bind(this);
				this.toolbarHideHandler = this.onToolbarHide.bind(this);
				this.mouseWheelHandler = this.onMouseWheel.bind(this);
				this.zoomPanRotateTransformHandler = this.onZoomPanRotateTransform
						.bind(this)
			}
			if (i.Browser.android) {
				this.orientationEventName = "resize"
			} else {
				if (i.Browser.iOS && (!i.Browser.safari)) {
					i.Events.add(f.document.body, "orientationchange",
							this.windowOrientationChangeHandler)
				} else {
					var l = !i.isNothing(f.onorientationchange);
					this.orientationEventName = l ? "orientationchange"
							: "resize"
				}
			}
			if (!i.isNothing(this.orientationEventName)) {
				i.Events.add(f, this.orientationEventName,
						this.windowOrientationChangeHandler)
			}
			i.Events.add(f, "scroll", this.windowScrollHandler);
			if (this.settings.enableKeyboard) {
				i.Events.add(f.document, "keydown", this.keyDownHandler)
			}
			if (this.isBackEventSupported
					&& this.settings.backButtonHideEnabled) {
				this.windowHashChangeHandler = this.onWindowHashChange
						.bind(this);
				if (this.settings.jQueryMobile) {
					f.location.hash = this.settings.jQueryMobileDialogHash
				} else {
				}
				i.Events.add(f, "hashchange", this.windowHashChangeHandler)
			}
			if (this.settings.enableMouseWheel) {
				i.Events.add(f, "mousewheel", this.mouseWheelHandler)
			}
			i.Events.add(this.uiLayer, i.TouchElement.EventTypes.onTouch,
					this.uiLayerTouchHandler);
			i.Events.add(this.carousel, h.EventTypes.onSlideByEnd,
					this.carouselSlideByEndHandler);
			i.Events.add(this.carousel, h.EventTypes.onSlideshowStart,
					this.carouselSlideshowStartHandler);
			i.Events.add(this.carousel, h.EventTypes.onSlideshowStop,
					this.carouselSlideshowStopHandler);
			if (!i.isNothing(this.toolbar)) {
				i.Events.add(this.toolbar, d.EventTypes.onTap,
						this.toolbarTapHandler);
				i.Events.add(this.toolbar, d.EventTypes.onBeforeShow,
						this.toolbarBeforeShowHandler);
				i.Events.add(this.toolbar, d.EventTypes.onShow,
						this.toolbarShowHandler);
				i.Events.add(this.toolbar, d.EventTypes.onBeforeHide,
						this.toolbarBeforeHideHandler);
				i.Events.add(this.toolbar, d.EventTypes.onHide,
						this.toolbarHideHandler)
			}
		},
		removeEventHandlers : function() {
			if (i.Browser.iOS && (!i.Browser.safari)) {
				i.Events.remove(f.document.body, "orientationchange",
						this.windowOrientationChangeHandler)
			}
			if (!i.isNothing(this.orientationEventName)) {
				i.Events.remove(f, this.orientationEventName,
						this.windowOrientationChangeHandler)
			}
			i.Events.remove(f, "scroll", this.windowScrollHandler);
			if (this.settings.enableKeyboard) {
				i.Events.remove(f.document, "keydown", this.keyDownHandler)
			}
			if (this.isBackEventSupported
					&& this.settings.backButtonHideEnabled) {
				i.Events.remove(f, "hashchange", this.windowHashChangeHandler)
			}
			if (this.settings.enableMouseWheel) {
				i.Events.remove(f, "mousewheel", this.mouseWheelHandler)
			}
			if (!i.isNothing(this.uiLayer)) {
				i.Events.remove(this.uiLayer,
						i.TouchElement.EventTypes.onTouch,
						this.uiLayerTouchHandler)
			}
			if (!i.isNothing(this.toolbar)) {
				i.Events.remove(this.carousel, h.EventTypes.onSlideByEnd,
						this.carouselSlideByEndHandler);
				i.Events.remove(this.carousel, h.EventTypes.onSlideshowStart,
						this.carouselSlideshowStartHandler);
				i.Events.remove(this.carousel, h.EventTypes.onSlideshowStop,
						this.carouselSlideshowStopHandler)
			}
			if (!i.isNothing(this.toolbar)) {
				i.Events.remove(this.toolbar, d.EventTypes.onTap,
						this.toolbarTapHandler);
				i.Events.remove(this.toolbar, d.EventTypes.onBeforeShow,
						this.toolbarBeforeShowHandler);
				i.Events.remove(this.toolbar, d.EventTypes.onShow,
						this.toolbarShowHandler);
				i.Events.remove(this.toolbar, d.EventTypes.onBeforeHide,
						this.toolbarBeforeHideHandler);
				i.Events.remove(this.toolbar, d.EventTypes.onHide,
						this.toolbarHideHandler)
			}
		},
		hide : function() {
			if (this.settings.preventHide) {
				return
			}
			if (i.isNothing(this.documentOverlay)) {
				throw "Jviewer.PhotoSwipe.PhotoSwipeClass.hide: PhotoSwipe instance is already hidden"
			}
			if (!i.isNothing(this.hiding)) {
				return
			}
			this.destroyZoomPanRotate();
			this.removeEventHandlers();
			i.Events.fire(this, {
				type : a.EventTypes.onBeforeHide,
				target : this
			});
			this.uiLayer.dispose();
			this.uiLayer = null;
			if (!i.isNothing(this.toolbar)) {
				this.toolbar.dispose();
				this.toolbar = null
			}
			this.carousel.dispose();
			this.carousel = null;
			i.DOM.removeClass(f.document.body, a.CssClasses.activeBody);
			this.documentOverlay.dispose();
			this.documentOverlay = null;
			a.unsetActivateInstance();
			i.Events.fire(this, {
				type : a.EventTypes.onHide,
				target : this
			});
			this.goBackInHistory()
		},
		goBackInHistory : function() {
			if (this.isBackEventSupported
					&& this.settings.backButtonHideEnabled) {
				if (!this.backButtonClicked) {
					f.history.back()
				}
			}
		},
		play : function() {
			if (this.isZoomActive()) {
				return
			}
			if (!this.settings.preventSlideshow) {
				if (!i.isNothing(this.carousel)) {
					this.fadeOutToolbarIfVisible();
					this.carousel.startSlideshow()
				}
			}
		},
		stop : function() {
			if (this.isZoomActive()) {
				return
			}
			if (!i.isNothing(this.carousel)) {
				this.carousel.stopSlideshow()
			}
		},
		previous : function() {
			if (this.isZoomActive()) {
				return
			}
			if (!i.isNothing(this.carousel)) {
				this.carousel.previous()
			}
		},
		next : function() {
			if (this.isZoomActive()) {
				return
			}
			if (!i.isNothing(this.carousel)) {
				this.carousel.next()
			}
		},
		toggleToolbar : function() {
			if (this.isZoomActive()) {
				return
			}
			if (!i.isNothing(this.toolbar)) {
				this.toolbar.toggleVisibility(this.currentIndex)
			}
		},
		fadeOutToolbarIfVisible : function() {
			if (!i.isNothing(this.toolbar) && this.toolbar.isVisible
					&& this.settings.captionAndToolbarAutoHideDelay > 0) {
				this.toolbar.fadeOut()
			}
		},
		createZoomPanRotate : function() {
			this.stop();
			if (this.canUserZoom() && !this.isZoomActive()) {
				i.Events.fire(this, a.EventTypes.onBeforeZoomPanRotateShow);
				this.zoomPanRotate = new c.ZoomPanRotateClass(this.settings,
						this.cache.images[this.currentIndex], this.uiLayer);
				i.Events.add(this.zoomPanRotate,
						a.ZoomPanRotate.EventTypes.onTransform,
						this.zoomPanRotateTransformHandler);
				i.Events.fire(this, a.EventTypes.onZoomPanRotateShow);
				this.fadeOutToolbarIfVisible()
			}
		},
		destroyZoomPanRotate : function() {
			if (!i.isNothing(this.zoomPanRotate)) {
				i.Events.fire(this, a.EventTypes.onBeforeZoomPanRotateHide);
				i.Events.remove(this.zoomPanRotate,
						a.ZoomPanRotate.EventTypes.onTransform,
						this.zoomPanRotateTransformHandler);
				this.zoomPanRotate.dispose();
				this.zoomPanRotate = null;
				i.Events.fire(this, a.EventTypes.onZoomPanRotateHide)
			}
		},
		canUserZoom : function() {
			var m, l;
			if (i.Browser.msie) {
				m = document.createElement("div");
				if (i.isNothing(m.style.msTransform)) {
					return false
				}
			} else {
				if (!i.Browser.isCSSTransformSupported) {
					return false
				}
			}
			if (!this.settings.allowUserZoom) {
				return false
			}
			if (this.carousel.isSliding) {
				return false
			}
			l = this.cache.images[this.currentIndex];
			if (i.isNothing(l)) {
				return false
			}
			if (l.isLoading) {
				return false
			}
			return true
		},
		isZoomActive : function() {
			return (!i.isNothing(this.zoomPanRotate))
		},
		getCurrentImage : function() {
			return this.cache.images[this.currentIndex]
		},
		onDocumentOverlayFadeIn : function(l) {
			f.setTimeout(function() {
				i.DOM.removeClass(f.document.body, a.CssClasses.buildingBody);
				i.DOM.addClass(f.document.body, a.CssClasses.activeBody);
				this.addEventHandlers();
				this.carousel.show(this.currentIndex);
				this.uiLayer.show();
				if (this.settings.autoStartSlideshow) {
					this.play()
				} else {
					if (!i.isNothing(this.toolbar)) {
						this.toolbar.show(this.currentIndex)
					}
				}
				i.Events.fire(this, {
					type : a.EventTypes.onShow,
					target : this
				})
			}.bind(this), 250)
		},
		onWindowScroll : function(l) {
			this.resetPosition()
		},
		onWindowOrientationChange : function(l) {
			this.resetPosition()
		},
		onWindowHashChange : function(l) {
		},
		onKeyDown : function(l) {
			if (l.keyCode === 37) {
				nahf.preventDefault(l);
				this.previous()
			} else {
				if (l.keyCode === 39) {
					nahf.preventDefault(l);
					this.next()
				} else {
					if (l.keyCode === 38 || l.keyCode === 40) {
						nahf.preventDefault(l)
					} else {
						if (l.keyCode === 27) {
							nahf.preventDefault(l);
							this.hide()
						} else {
							if (l.keyCode === 32) {
								if (!this.settings.hideToolbar) {
									this.toggleToolbar()
								} else {
									this.hide()
								}
								nahf.preventDefault(l)
							}
						}
					}
				}
			}
		},
		onUILayerTouch : function(q) {
			if (this.isZoomActive()) {
				switch (q.action) {
				case i.TouchElement.ActionTypes.gestureChange:
					this.zoomPanRotate
							.zoomRotate(
									q.scale,
									(this.settings.allowRotationOnUserZoom) ? q.rotation
											: 0);
					break;
				case i.TouchElement.ActionTypes.gestureEnd:
					this.zoomPanRotate
							.setStartingScaleAndRotation(
									q.scale,
									(this.settings.allowRotationOnUserZoom) ? q.rotation
											: 0);
					break;
				case i.TouchElement.ActionTypes.touchStart:
					this.zoomPanRotate.panStart(q.point);
					break;
				case i.TouchElement.ActionTypes.touchMove:
					this.zoomPanRotate.pan(q.point);
					break;
				case i.TouchElement.ActionTypes.doubleTap:
					this.destroyZoomPanRotate();
					this.toggleToolbar();
					break;
				case i.TouchElement.ActionTypes.swipeLeft:
					this.destroyZoomPanRotate();
					this.next();
					this.toggleToolbar();
					break;
				case i.TouchElement.ActionTypes.swipeRight:
					this.destroyZoomPanRotate();
					this.previous();
					this.toggleToolbar();
					break
				}
			} else {
				switch (q.action) {
				case i.TouchElement.ActionTypes.touchMove:
				case i.TouchElement.ActionTypes.swipeLeft:
				case i.TouchElement.ActionTypes.swipeRight:
					this.fadeOutToolbarIfVisible();
					this.carousel.onTouch(q.action, q.point);
					break;
				case i.TouchElement.ActionTypes.touchStart:
				case i.TouchElement.ActionTypes.touchMoveEnd:
					this.carousel.onTouch(q.action, q.point);
					break;
				case i.TouchElement.ActionTypes.tap:
					this.toggleToolbar();
					break;
				case i.TouchElement.ActionTypes.doubleTap:
					this.toolbar.fadeOut();
					q.point.x -= i.DOM.windowScrollLeft();
					q.point.y -= i.DOM.windowScrollTop();
					var o = this.cache.images[this.currentIndex].imageEl, p = f
							.parseInt(i.DOM.getStyle(o, "top"), 10), l = f
							.parseInt(i.DOM.getStyle(o, "left"), 10), m = l
							+ i.DOM.width(o), n = p + i.DOM.height(o);
					if (q.point.x < l) {
						q.point.x = l
					} else {
						if (q.point.x > m) {
							q.point.x = m
						}
					}
					if (q.point.y < p) {
						q.point.y = p
					} else {
						if (q.point.y > n) {
							q.point.y = n
						}
					}
					this.createZoomPanRotate();
					if (this.isZoomActive()) {
						this.zoomPanRotate.zoomAndPanToPoint(
								this.settings.doubleTapZoomLevel, q.point)
					}
					break;
				case i.TouchElement.ActionTypes.gestureStart:
					this.toolbar.fadeOut();
					this.createZoomPanRotate();
					break
				}
			}
			i.Events.fire(this, {
				type : a.EventTypes.onTouch,
				target : this,
				point : q.point,
				action : q.action
			})
		},
		onCarouselSlideByEnd : function(l) {
			this.currentIndex = l.cacheIndex;
			if (!i.isNothing(this.toolbar)) {
				this.toolbar.setCaption(this.currentIndex);
				this.toolbar.setToolbarStatus(this.currentIndex)
			}
			i.Events.fire(this, {
				type : a.EventTypes.onDisplayImage,
				target : this,
				action : l.action,
				index : l.cacheIndex
			})
		},
		onToolbarTap : function(l) {
			switch (l.action) {
			case d.ToolbarAction.next:
				this.next();
				break;
			case d.ToolbarAction.previous:
				this.previous();
				break;
			case d.ToolbarAction.close:
				this.hide();
				break;
			case d.ToolbarAction.play:
				this.play();
				break
			}
			i.Events.fire(this, {
				type : a.EventTypes.onToolbarTap,
				target : this,
				toolbarAction : l.action,
				tapTarget : l.tapTarget
			})
		},
		onMouseWheel : function(m) {
			var n = i.Events.getWheelDelta(m), l = m.timeStamp
					- (this.mouseWheelStartTime || 0);
			if (l < this.settings.mouseWheelSpeed) {
				return
			}
			this.mouseWheelStartTime = m.timeStamp;
			if (this.settings.invertMouseWheel) {
				n = n * -1
			}
			if (n < 0) {
				this.next()
			} else {
				if (n > 0) {
					this.previous()
				}
			}
		},
		onCarouselSlideshowStart : function(l) {
			i.Events.fire(this, {
				type : a.EventTypes.onSlideshowStart,
				target : this
			})
		},
		onCarouselSlideshowStop : function(l) {
			i.Events.fire(this, {
				type : a.EventTypes.onSlideshowStop,
				target : this
			})
		},
		onToolbarBeforeShow : function(l) {
			i.Events.fire(this, {
				type : a.EventTypes.onBeforeCaptionAndToolbarShow,
				target : this
			})
		},
		onToolbarShow : function(l) {
			i.Events.fire(this, {
				type : a.EventTypes.onCaptionAndToolbarShow,
				target : this
			})
		},
		onToolbarBeforeHide : function(l) {
			i.Events.fire(this, {
				type : a.EventTypes.onBeforeCaptionAndToolbarHide,
				target : this
			})
		},
		onToolbarHide : function(l) {
			i.Events.fire(this, {
				type : a.EventTypes.onCaptionAndToolbarHide,
				target : this
			})
		},
		onZoomPanRotateTransform : function(l) {
			i.Events.fire(this, {
				target : this,
				type : a.EventTypes.onZoomPanRotateTransform,
				scale : l.scale,
				rotation : l.rotation,
				rotationDegs : l.rotationDegs,
				translateX : l.translateX,
				translateY : l.translateY
			})
		}
	})
}(window, window.klass, window.Jviewer.Util,
		window.Jviewer.Widget.PhotoSwipe.Cache,
		window.Jviewer.Widget.PhotoSwipe.DocumentOverlay,
		window.Jviewer.Widget.PhotoSwipe.Carousel,
		window.Jviewer.Widget.PhotoSwipe.Toolbar,
		window.Jviewer.Widget.PhotoSwipe.UILayer,
		window.Jviewer.Widget.PhotoSwipe.ZoomPanRotate));
(function(e) {
	var a = e.config, c = new nahf.Template(
			''), d = new nahf.Template(
			'<span class="count"><span class="total-count">#{itemNum}</span><span class="total-count">/#{totalCount}</span><span class="tit">\uac74</span></span><a href="#{articleUrl}" class="article">#{articleLinkText}</a>');
	var b = function(f) {
		main = f;
		this.create()
	};
	b.prototype = {
		create : function() {
			this.wrap = nahf
					.createElement('<div id="title-wrap" class="title-layer" data-position="fixed" style="display:none"></div>');
			this.buttons = nahf
					.createElement('<div class="button-layer"></div>');
			this.buttonClone = nahf
					.createElement('<div class="title-layer"	style="position:absolute;bottom:0;z-index:10000;display:block;background:none;"></div>');
			document.body.appendChild(this.wrap);
			if (nahf.Browser.ie7 || nahf.Browser.ie8) {
				document.body.appendChild(this.buttonClone)
			}
		},
		html : function(g) {
			nahf.HTMLStack.innerHTML = g.caption;
			var f = nahf.HTMLStack.innerHTML;
			if (g.caption.length >= JviewerConfig.titleLength) {
				f = f.substring(0, JviewerConfig.titleLength) + "..."
			}
			g.caption = f;
			this.wrap.innerHTML = c.evaluate({
				url : g.articleUrl,
				caption : g.caption,
				cpKorName : g.cpKorName
			});
			this.buttons.innerHTML = d.evaluate({
				itemNum : g.countInfo.itemNum,
				totalCount : g.countInfo.totalCount,
				replyUrl : g.replyUrl,
				replyLinkText : g.replyLinkText,
				articleUrl : g.articleUrl,
				articleLinkText : g.articleLinkText
			});
			this.wrap.appendChild(this.buttons);
			this.buttonClone.innerHTML = this.wrap.innerHTML
		},
		show : function() {
			nahf.Fx.stop(this.wrap);
			nahf.setOpacity(this.wrap, a.opacity);
			nahf.show(this.wrap);
			nahf.show(this.buttonClone)
		},
		hide : function(f) {
			if (f) {
				nahf.hide(this.wrap)
			} else {
				nahf.Fx.animate(this.wrap, "opacity:0", {
					callback : function() {
						nahf.hide(this.wrap)
					}.bind(this)
				})
			}
			nahf.hide(this.buttonClone)
		}
	};
	e.TitleBar = b
})(Jviewer);
(function(d) {
	var c = d.config, a = "";
	var b = function(e) {
		a = e
	};
	b.prototype = {
		create : function(e) {
			this.prev = nahf
					.createElement('<div id="prev-button" class="btn"><div class="ico"></div></div>');
			this.next = nahf
					.createElement('<div id="next-button" class="btn"><div class="ico"></div></div>');
			this.close = nahf
					.createElement('<div id="close-button"><div class="ico"></div></div>');
			nahf.setOpacity(this.prev, c.opacity);
			nahf.setOpacity(this.next, c.opacity);
			nahf.setOpacity(this.close, c.opacity);
			nahf.addEvent(this.prev, "click", function() {
				a.swipe.previous()
			});
			nahf.addEvent(this.next, "click", function() {
				a.swipe.next()
			});
			nahf.addEvent(this.close, "click", function() {
				a.exit()
			});
			document.body.appendChild(this.prev);
			document.body.appendChild(this.next);
			document.body.appendChild(this.close);
			nahf.addEvent(window, "resize", this.resetPosition.bind(this));
			nahf.addEvent(window, "orientationchange", this.resetPosition
					.bind(this))
		},
		resetPosition : function() {
			var e = window.innerHeight || document.documentElement.clientHeight, f = parseInt(
					nahf.getStyle(this.prev, "height"), 10) / 2, g = e / 2 - f;
			nahf.setStyle(this.prev, {
				top : g + "px"
			});
			nahf.setStyle(this.next, {
				top : g + "px"
			})
		},
		show : function() {
			if (!this.next) {
				this.create()
			}
			this.showNext();
			this.showPrev();
			this.resetPosition();
			nahf.show(this.close)
		},
		hide : function() {
			this.hidePrev();
			this.hideNext();
			nahf.hide(this.close)
		},
		showNext : function() {
			if (!a.swipe.widget.toolbar.isVisible) {
				return
			}
			this.next && nahf.show(this.next)
		},
		showPrev : function() {
			if (!a.swipe.widget.toolbar.isVisible) {
				return
			}
			this.prev && nahf.show(this.prev)
		},
		hideNext : function() {
			try {
				nahf.hide(this.next)
			} catch (f) {
			}
		},
		hidePrev : function() {
			try {
				nahf.hide(this.prev)
			} catch (f) {
			}
		}
	};
	d.Icon = b
})(Jviewer);
(function(d) {
	var b = d.config, a = "";
	var c = function(e) {
		a = e;
		this.widget = "";
		this.setOption()
	};
	c.prototype = {
		callDummyIframe : function() {
			if (!b.useDummyIframe) {
				return
			}
			var f = (b.iframeUrl) ? b.iframeUrl + "?_="
					+ d.Util.randomString("10") : "javascript:0";
			var e = "emptyIframe";
			var g = document.getElementById(e);
			if (g) {
				document.body.removeChild(g)
			}
			g = document.createElement("iframe");
			g.id = e;
			g.className = "dummy_iframe";
			g.src = f;
			document.body.appendChild(g);
			nahf.hide(g);
			log("callDummyIframe : ", f);
			return g
		},
		render : function(e, f) {
			this.detatch();
			this.widget = d.Widget.PhotoSwipe.attach(e, this.option);
			this.show(f);
			this.bindEvent()
		},
		detatch : function() {
			if (this.widget) {
				a.hide(true);
				d.Widget.PhotoSwipe.detatch(this.widget);
				d.Widget.PhotoSwipe.unsetActivateInstance(this.widget)
			}
		},
		show : function(e) {
			this.widget.show(e)
		},
		showId : function(g) {
			var e = this.widget.originalImages;
			for ( var f = 0; f < e.length; f++) {
				if (e[f].id == g) {
					if (f < this.widget.currentIndex) {
						this.previous()
					} else {
						this.next()
					}
					return true
				}
			}
			return false
		},
		bindEvent : function() {
			this.widget.addEventHandler(
					d.Widget.PhotoSwipe.EventTypes.onDisplayImage, function(g) {
						this.callDummyIframe();
						var f = this.widget.getCurrentImage();
						log("onDisplayImage : ", g.action, g.index, f);
						a.onChangeSwipeImage(f)
					}.bind(this));
			this.widget.addEventHandler(d.Widget.PhotoSwipe.EventTypes.onShow,
					function(f) {
						a.show()
					}.bind(this));
			this.widget.addEventHandler(d.Widget.PhotoSwipe.EventTypes.onHide,
					function(f) {
						a.hide();
						a.exit()
					}.bind(this));
			this.widget.addEventHandler(
					d.Widget.PhotoSwipe.EventTypes.onCaptionAndToolbarShow,
					function(f) {
						a.show();
						a.setGalleryTitle();
						if (typeof b.show === "function") {
							b.show()
						}
					}.bind(this));
			this.widget
					.addEventHandler(
							d.Widget.PhotoSwipe.EventTypes.onBeforeCaptionAndToolbarHide,
							function(f) {
								a.hide();
								if (typeof b.hide === "function") {
									b.hide()
								}
							}.bind(this));
			this.widget.addEventHandler(
					d.Widget.PhotoSwipe.EventTypes.onCaptionAndToolbarHide,
					function(f) {
					}.bind(this))
		},
		stop : function() {
			this.widget.stop()
		},
		play : function() {
			this.widget.play()
		},
		previous : function() {
			this.widget.previous()
		},
		next : function() {
			this.widget.next()
		},
		setOption : function() {
			this.option = {
				loop : false,
				captionAndToolbarAutoHideDelay : 0,
				onPreviousEnd : a.loadApiPrevious.bind(a),
				onNextEnd : a.loadApiNext.bind(a),
				getImageSource : function(e) {
					return e.url
				},
				getImageCaption : function(e) {
					return e.caption
				}
			}
		}
	};
	d.Swipe = c
})(Jviewer);
(function(e) {
	var d = e.config, b = "";
	var f = function() {
		this.init()
	};
	f.prototype = {
		init : function() {
			var g = this.getVersion();
			switch (g.major) {
			case "2":
				if (g.minor == "2") {
					this.froyoFullscreen()
				} else {
					if (g.minor == "3") {
						this.gingerFullscreen();
						nahf.addEvent(window, "resize", this.gingerFullscreen
								.bind(this))
					}
				}
				break;
			case "3":
				return false;
				break;
			case "4":
				this.icecreamFullscreen();
				break
			}
			try {
				if (g.major == "4" && parseInt(g.minor, 10) >= 2) {
					nahf.addClassName($$("body")[0], "jelly")
				}
				if (/SHV\-E300S/.test(navigator.userAgent)) {
					$$("body")[0].style.height = "100%";
					$$("body")[0].style.overflow = "hidden"
				}
				if ((/LG\-F200K/).test(navigator.userAgent)) {
					nahf.addClassName($$("body")[0], "lg-view")
				}
				if (/DaumApps/.test(navigator.userAgent)) {
					nahf.addClassName($$("body")[0], "nahfmbl")
				}
			} catch (h) {
			}
		},
		getVersion : function() {
			var h = window.navigator.userAgent;
			var g = h.match(/Android [0-9].?[0-9]?/)[0].replace("Android ", "");
			return {
				major : g.split(".")[0],
				minor : g.split(".")[1]
			}
		},
		froyoFullscreen : function() {
			nahf.Function.timeout(function() {
				$("title-wrap").style.bottom = "-2px"
			});
			nahf.Function.timeout(function() {
				window.scrollTo(0, 1)
			}.bind(this), 1)
		},
		gingerFullscreen : function() {
			$$("body")[0].style.overflow = "auto";
			if (!this.el) {
				this.el = nahf.createElement("div", {
					style : "position:absolute;top:0;height:1px"
				});
				$$("body")[0].appendChild(this.el);
				this.titleOffset = 2
			}
			var g = this.el.style.height.toInt() + 1;
			nahf.Function.timeout(function() {
				$("title-wrap").style.bottom = "-" + this.titleOffset + "px"
			}.bind(this));
			this.titleOffset++;
			this.el.style.height = g + "px";
			window.scrollTo(0, g)
		},
		icecreamFullscreen : function() {
			this.hideAddressBar();
			nahf.addEvent(window, "orientationchange", this.setIceCreamPosition
					.bind(this))
		},
		hideAddressBar : function() {
			nahf.Function.timeout(function() {
				window.scrollTo(0, 1);
				$("title-wrap").style.position = "fixed"
			}.bind(this), 1000)
		},
		setIceCreamPosition : function() {
			this.hideAddressBar();
			nahf.Function.timeout(function() {
				$("title-wrap").style.position = "absolute";
				$("title-wrap").style.bottom = "0"
			}, 1000)
		},
		checkRotateMode : function() {
			var h = nahf.Browser.getWindowSize();
			var g = h.height;
			var i = h.width;
			this.isOrientChange = true;
			if (i > g) {
				return "landscape"
			} else {
				return "portrait"
			}
		}
	};
	var c = function() {
		this.init()
	};
	c.prototype = {
		init : function() {
			if (e.Util.Browser.uiwebview) {
				nahf.addClassName($$("body")[0], "nahfmbl")
			}
			var g = this.getOSVersion();
			switch (g) {
			case "4":
				this.ios4fullscreen();
				break;
			case "5":
				if (Jviewer.Util.Browser.uiwebview) {
					this.ios5uiwebview()
				} else {
					this.ios5fullscreen()
				}
				break;
			case "6":
				if (Jviewer.Util.Browser.uiwebview) {
					this.ios5uiwebview()
				} else {
					this.ios6fullscreen()
				}
				break
			}
		},
		checkRotateMode : function() {
			var h = nahf.Browser.getWindowSize();
			var g = h.height;
			var i = h.width;
			if (i > g) {
				return "landscape"
			} else {
				return "portrait"
			}
		},
		getDeviceType : function() {
			var g = Jviewer.Util.Browser;
			var h = "";
			if (g.iPad) {
				h = "iPad"
			}
			if (g.iPhone) {
				h = "iPhone"
			}
			return h
		},
		getOSVersion : function() {
			var g = window.navigator.userAgent;
			return g.match(/OS [0-9]/).join().replace("OS ", "")
		},
		hideAddressBar : function() {
			nahf.Function.timeout(function() {
				window.scrollTo(0, 1)
			}.bind(this), 1)
		},
		setIOS4Elements : function() {
			this.title = $("title-wrap");
			this.imageWrap = $$(".ps-carousel")[0];
			this.caption = $$(".ps-caption")[0];
			this.title.style.position = "absolute";
			this.setIOS4Position()
		},
		setIOS4Position : function() {
			if (e.Util.Browser.uiwebview) {
				this.title.style.bottom = "-3px";
				return
			}
			var g = this.checkRotateMode();
			if (this.currentMode != g) {
				this.hideAddressBar();
				if (this.isIOS4 && this.imageWrap) {
					var h = this.OFFSET;
					this.imageWrap.style.top = "0px";
					this.caption.style.top = "1px";
					this.title.style.bottom = "-" + h + "px"
				}
				this.currentMode = g
			}
		},
		ios4fullscreen : function() {
			this.isIOS4 = true;
			this.OFFSET = 61;
			this.initMode = this.checkRotateMode();
			nahf.Function.timeout(function() {
				this.setIOS4Elements();
				this.hideAddressBar()
			}.bind(this), 1000);
			nahf.addEvent(window, "orientationchange", this.setIOS4Position
					.bind(this))
		},
		ios5fullscreen : function() {
			this.hideAddressBar();
			nahf.Function.timeout(function() {
				var g = (this.isIPAD) ? 61 : window.innerHeight
						- document.documentElement.clientHeight;
				nahf.Function.timeout(function() {
					$("title-wrap").style.position = "absolute";
					$("title-wrap").style.bottom = "-" + g + "px"
				});
				nahf.addEvent(window, "resize", function() {
					window.scrollTo(0, 1);
					$("title-wrap").style.bottom = "-" + g + "px"
				})
			}, 100)
		},
		ios5uiwebview : function() {
			this.hideAddressBar();
			nahf.Function.interval(function() {
				window.scrollTo(0, 1);
				$("title-wrap").style.bottom = "-2px"
			}, 100)
		},
		ios6fullscreen : function() {
			this.ios5fullscreen();
			if (this.getDeviceType() == "iPhone") {
				nahf.Function.interval(this.checkOS6Fullscreen, 400)
			}
		},
		checkOS6Fullscreen : function() {
			if (/CriOS/.test(navigator.userAgent)) {
				$("title-wrap").style.bottom = "0"
			} else {
				if (document.documentElement.clientHeight == 320) {
					$("title-wrap").style.bottom = "0";
					window.scroll(0, 0)
				} else {
					if (document.documentElement.clientWidth != 320) {
						window.scrollTo(0, 1);
						var g = window.innerHeight
								- document.documentElement.clientHeight;
						g = (g == 0) ? 60 : g;
						$("title-wrap").style.bottom = "-" + g + "px"
					} else {
						$("title-wrap").style.bottom = "-61px"
					}
				}
			}
		}
	};
	var a = function() {
		this.init()
	};
	a.prototype = {
		init : function() {
			var g = this.getOsName();
			switch (g) {
			case "IOS":
				new c();
				break;
			case "ANDROID":
				new f();
				break
			}
		},
		getOsName : function() {
			var g = Jviewer.Util.Browser;
			var h = "";
			if (g.iOS) {
				h = "IOS"
			} else {
				if (g.android) {
					h = "ANDROID"
				}
			}
			return h
		}
	};
	e.FullScreen = a
})(Jviewer);
(function(c) {
	var b = c.config;
	var a = function(d) {
		c.main = this;
		this.setDebug();
		nahf.extend(b, d);
		this.prevImage = {
			url : "",
			title : ""
		};
		this.swipe = new c.Swipe(this);
		this.titleBar = new c.TitleBar(this);
		this.icon = new c.Icon(this);
		this.isApiLoading = false;
		this.page = nahf.urlParameter.page || 1;
		this.pageSize = nahf.urlParameter.page_size || b.pageSize;
		this.totalCount = 0;
		this.totalPage = 0;
		this.itemRowCount = 0;
		this.actionType = "next";
		this.galleryId = nahf.urlParameter.gid || nahf.urlParameter.galleryId
				|| b.defalutGalleryId;
		this.keyword = nahf.urlParameter.keyword;
		if (this.keyword) {
			this.galleryId = ""
		}
		this.articleId = "";
		this.callNewsId = "";
		if (location.hash) {
			this.callNewsId = location.hash.replace(/^#/, "")
		}
		this.articleUrlTmpl = new nahf.Template(b.articleUrl);
		this.replyUrlTmpl = new nahf.Template(b.replyUrl);
		this.setUserAgent();
		this.loadApi();
		this.bindEvent();
		this.checkHash();
		this.isApp = Jviewer.Util.isAppMode()
	};
	a.prototype = {
		setUserAgent : function() {
			var d = navigator.userAgent.toLowerCase();
			if (d.indexOf("android") > -1) {
				nahf.addClassName(document.body, "android");
				if (d.indexOf("android 4") > -1) {
					this.isICS = true
				}
			}
		},
		checkHash : function() {
			window.onhashchange = function() {
				var g = location.hash.replace(/^#/, "");
				if (g == this.articleId || g == this.callNewsId) {
					return
				}
				log("hash change", g, this.articleId);
				var d = this.swipe.showId(g);
				if (!d) {
					this.callNewsId = g;
					this.loadApi()
				}
				try {
					nahfApps.refreshToolbar()
				} catch (f) {
				}
			}.bind(this)
		},
		hide : function(d) {
			this.titleBar.hide(d);
			this.icon.hide();
			nahf.hide(this.captionWrap)
		},
		show : function() {
			this.titleBar.show();
			this.icon.show();
			this.checkDisplayIcon();
			nahf.show(this.captionWrap)
		},
		onChangeSwipeImage : function(d) {
			this.articleId = d.refObj.id;
			location.hash = "#" + this.articleId;
			callTiara(location.href, "\ud3ec\ud1a0\ubdf0\uc5b4", b.tiaraDomain);
			this.setGalleryTitle();
			this.setTitleBar(d);
			if (this.prevImage.url != d.refObj.url) {
				if (typeof b.callback === "function") {
					b.callback(d.refObj)
				}
				this.prevImage = d.refObj
			}
		},
		setTitleBar : function(e) {
			if (this.isApiLoading) {
				return
			}
			this.itemNum = ((this.page - 1) * b.pageSize)
					+ (this.swipe.widget.currentIndex + 1);
			var d = this.articleUrlTmpl.evaluate({
				articleId : e.refObj.id
			});
			var f = this.replyUrlTmpl.evaluate({
				articleId : e.refObj.id
			});
			this.titleBar.html({
				caption : e.caption,
				articleUrl : d,
				articleLinkText : b.articleLinkText,
				replyUrl : f,
				replyLinkText : b.replyLinkText,
				cpKorName : e.refObj.cpKorName,
				countInfo : {
					itemNum : this.itemNum,
					totalCount : this.totalCount
				}
			});
			this.checkDisplayIcon()
		},
		setGalleryTitle : function() {
			var e = (JviewerConfig.galleryTitleLength) ? JviewerConfig.galleryTitleLength
					: "100";
			nahf.HTMLStack.innerHTML = this.galleryTitle;
			this.galleryTitle = nahf.HTMLStack.innerHTML;
			if (this.galleryTitle.length > e) {
				this.galleryTitle = this.galleryTitle.substring(0, e) + ".."
			}
			nahf.HTMLStack.innerHTML = "";
			var d = this.galleryTitle;
			$$(".ps-caption-content")[0].innerHTML = d;
			if (!this.captionDiv) {
				this.captionWrap = nahf.createElement("div", {
					"class" : "ps-caption",
					style : "top:0;left:0;position:absolute;background: none;"
				});
				this.captionDiv = nahf.createElement("div", {
					"class" : "ps-caption-content",
					style : "z-index:1000;color:#fff;"
				})
			}
			if (nahf.Browser.ie) {
				this.captionDiv.innerHTML = d;
				this.captionWrap.appendChild(this.captionDiv);
				document.body.appendChild(this.captionWrap)
			}
		},
		checkDisplayIcon : function() {
			if (this.itemNum == 1) {
				this.icon.hidePrev()
			} else {
				this.icon.showPrev()
			}
			if (this.itemNum == this.totalCount) {
				this.icon.hideNext()
			} else {
				this.icon.showNext()
			}
		},
		bindEvent : function() {
			nahf.addEvent(this.titleBar.wrap, "touchmove", function(d) {
				nahf.stopEvent(d)
			})
		},
		parseApiUrl : function(d, e) {
			return new nahf.Template(d).evaluate(e)
		},
		loadApiPrevious : function() {
			if (this.page == 1) {
				log("\uccab \ud398\uc774\uc9c0 \uc785\ub2c8\ub2e4!");
				return
			} else {
				this.page--
			}
			this.actionType = "previous";
			this.loadApi()
		},
		loadApiNext : function() {
			if (this.page == this.totalPage) {
				log("\ub9c8\uc9c0\ub9c9 \ud398\uc774\uc9c0 \uc785\ub2c8\ub2e4!");
				return
			} else {
				this.page++
			}
			this.actionType = "next";
			this.loadApi()
		},
		loadApi : function() {
			if (this.isApiLoading) {
				return
			}
			try {
				nahf.hide($$(".ps-caption")[0]);
				nahf.hide($$(".ps-caption")[1])
			} catch (f) {
			}
			this.isApiLoading = true;
			this.totalCount = parseInt(imageList.length,
					10);
			this.totalPage = Math.ceil(this.totalCount / this.pageSize);
			this.page = 1;
			this.itemRowCount = imageList.length;
			this.galleryTitle = galleryTitle;
			console.log("totalCount:", this.totalCount, ",totalPage:",
					this.totalPage, ",page:", this.page, ",pageSize:",
					this.pageSize, ",itemRowCount:", this.itemRowCount);
			var j = imageList;
			var e = [];
			if (j.length == 0) {
				log("data\uac00 \uc5c6\uc2b5\ub2c8\ub2e4!");
				return
			}
			for ( var g = 0; g < j.length; g++) {
				if (this.callNewsId && String(this.callNewsId) == j[g].id) {
					this.callNewsIdIndex = g
				}
				
				e.push({
					url : 'http://contents.nahf.or.kr/directory/downloadItemFile.do?'+j[g],
					caption : '',
					id : j[g],
					cpKorName : ''
				})
			}
			this.currentApiItems = e;
			this.renderSwipe(e);
			this.isApiLoading = false;
			
			
			/*
			var d = this.parseApiUrl(b.apiUrl, {
				galleryId : this.galleryId,
				pageSize : this.pageSize,
				page : this.page,
				keyword : this.keyword,
				articleId : this.callNewsId
			});
			log(d);
			this.isApiLoading = true;
			
			$.getJSON(d, function(h) {
				console.log(h);
				this.totalCount = parseInt(h.imageList.length,
						10);
				this.totalPage = Math.ceil(this.totalCount / this.pageSize);
				this.page = 1;
				this.itemRowCount = h.imageList.length;
				this.galleryTitle = h.itemLevel.mainTitle;
				console.log("totalCount:", this.totalCount, ",totalPage:",
						this.totalPage, ",page:", this.page, ",pageSize:",
						this.pageSize, ",itemRowCount:", this.itemRowCount);
				var j = h.imageList;
				var e = [];
				if (j.length == 0) {
					log("data\uac00 \uc5c6\uc2b5\ub2c8\ub2e4!");
					return
				}
				for ( var g = 0; g < j.length; g++) {
					if (this.callNewsId && String(this.callNewsId) == j[g].id) {
						this.callNewsIdIndex = g
					}
					console.log('http://contents.nahf.or.kr/files/'+j[g]);
					e.push({
						url : 'http://contents.nahf.or.kr/files/'+j[g],
						caption : '',
						id : j[g],
						cpKorName : ''
					})
				}
				this.currentApiItems = e;
				this.renderSwipe(e);
				this.isApiLoading = false
			}.bind(this))
			*/
		},
		reRender : function() {
			this.renderSwipe(this.currentApiItems)
		},
		renderSwipe : function(d) {
			if (this.callNewsId && this.callNewsIdIndex > -1) {
				this.swipe.render(d, this.callNewsIdIndex)
			} else {
				var e = (this.actionType == "next") ? 0 : this.itemRowCount - 1;
				this.swipe.render(d, e)
			}
			this.callNewsId = ""
		},
		exit : function() {
			if (!b.closeUrl) {
				return
			}
			var d = new nahf.Template(b.closeUrl).evaluate({
				galleryId : this.galleryId,
				articleId : this.articleId,
				keyword : this.keyword
			});
			location.href = d
		},
		setDebug : function() {
			var d = new Debug(b.appName, "log");
			window.log = d.print.bind(d)
		}
	};
	nahf.addEvent(window, "load", function() {
		var d = Jviewer.Util.Browser;
		if (d.android || d.iPhone || d.iPad) {
			new c.FullScreen()
		} else {
			if (d.msie) {
				var e = d.ua.toLowerCase();
				if (e.indexOf("msie 8") > -1 || e.indexOf("msie 7") > -1) {
					b.opacity = 0.6
				}
			}
		}
		window.photoViewerInstance = new a(JviewerConfig)
	})
})(Jviewer);